添加 Realm Cocoapod 时重复符号
Duplicate Symbols when adding Realm Cocoapod
我第一次尝试在实际项目中使用Realm,我已经通过Cocoapods成功添加了它。我正在使用 Xcode 6.4,但在同一台机器上安装了 Xcode 7.1 beta(用于其他项目)。
尝试构建项目或 运行 单元测试(在模拟器上)时,我收到一个链接器错误,指出有数十对文件被复制。貌似一个提到了 Bitcode,一个没有。
我正在使用 Xcode 6.4 – 为什么它甚至知道 Bitcode?这是错误的一小部分示例:
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(row-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(row-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(spec-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(spec-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(table-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(table-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(table_view-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(table_view-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(unicode-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(unicode-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(utilities-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(utilities-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(version-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
我看到其他人在谈论类似的问题,但不是 Xcode 6.4,也不是简单地 运行 安装应用程序,而不是提交到商店。
我还应该指出,将 Realm 添加为静态框架(从 0.95.3
的 xcode-6
文件夹中可以完美地工作,所以这与我从 Cocoapods 获得的构建有关,好像。
我可以在这里做什么?如果可能的话,我真的宁愿从 Cocoapods 得到它。
根据您使用的 Xcode 版本,需要不同版本的 Realm 核心库,因此当您 [=25] 时,使用 xcode-select
激活相同版本很重要=] pod install
用于构建项目。由于下载了 Xcode 7 版本的库,您可能激活了该版本的 Xcode。 运行 sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
(假设那是你安装了 Xcode 6 的地方;根据需要调整它),删除 Pods
目录,然后重新 运行 pod install
.
您可以通过 xcrun swiftc -v
查看您激活的 Xcode 版本。
我第一次尝试在实际项目中使用Realm,我已经通过Cocoapods成功添加了它。我正在使用 Xcode 6.4,但在同一台机器上安装了 Xcode 7.1 beta(用于其他项目)。
尝试构建项目或 运行 单元测试(在模拟器上)时,我收到一个链接器错误,指出有数十对文件被复制。貌似一个提到了 Bitcode,一个没有。
我正在使用 Xcode 6.4 – 为什么它甚至知道 Bitcode?这是错误的一小部分示例:
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(row-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(row-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(spec-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(spec-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(table-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(table-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(table_view-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(table_view-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(unicode-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(unicode-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(utilities-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(utilities-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.cmdline in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(version-iPhoneSimulator-bitcode.o)
duplicate symbol _llvm.embedded.module in:
/Users/me/Source/our-project-ios/Pods/Realm/core/librealm-ios.a(bptree-iPhoneSimulator-bitcode.o)
我看到其他人在谈论类似的问题,但不是 Xcode 6.4,也不是简单地 运行 安装应用程序,而不是提交到商店。
我还应该指出,将 Realm 添加为静态框架(从 0.95.3
的 xcode-6
文件夹中可以完美地工作,所以这与我从 Cocoapods 获得的构建有关,好像。
我可以在这里做什么?如果可能的话,我真的宁愿从 Cocoapods 得到它。
根据您使用的 Xcode 版本,需要不同版本的 Realm 核心库,因此当您 [=25] 时,使用 xcode-select
激活相同版本很重要=] pod install
用于构建项目。由于下载了 Xcode 7 版本的库,您可能激活了该版本的 Xcode。 运行 sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
(假设那是你安装了 Xcode 6 的地方;根据需要调整它),删除 Pods
目录,然后重新 运行 pod install
.
您可以通过 xcrun swiftc -v
查看您激活的 Xcode 版本。