我目前在我的一个项目中使用 Realm,我在其中手动安装了它。一切正常,直到我将 Xcode 从 10.1 更新到 10.2。现在我不断收到以下错误。
Swift 5.0 编译器无法导入使用 Swift 4.2 编译的模块:/Users/userName/MyApp/RealmSwift.framework/Modules/RealmSwift.swiftmodule/i386.swiftmodule
我相信这与以下事实有关:当我尝试用为 Xcode 10.2 编译Realm frameworks的最新版本替换我的项目中的Realm为Xcode 10.2
无论如何,我现在想尝试在每次更新 Xcode 时
使用Realmthrough来消除此类问题,所以我的问题是……</p>Cocoapods
为了让我从手动安装转移到通过 Cocoapods 使用 Realm,我需要在 Xcode 中进行哪些更改?
我在框架搜索路径中需要什么?
我需要删除
Run Script Phasebash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework/strip-frameworks.sh"吗?我的 Pod 文件中需要什么?由于在文档中找不到任何信息,我更感兴趣的是如何合并
Realm我的。WatchApp Extension
这是我的 Pod 文件现在的样子。
豆荚文件
#platform :ios, '9.3'
target 'MyApp' do
use_frameworks!
# Pods for MyApp
pod 'Firebase/Core'
pod 'NVActivityIndicatorView'
target 'MyAppTests' do
inherit! :search_paths
end
target 'MyAppUITests' do
inherit! :search_paths
end
end
target 'MyApp Watch App' do
use_frameworks!
end
target 'MyApp Watch App Extension' do
use_frameworks!
end
仅供参考 - 我已经在我的项目中使用 Cocoapods 但还Realm没有。另外,我在这个项目中Realm使用iOS和。WatchApp Extension