gpt4 book ai didi

ios - 添加 Realm Cocoapod 时重复符号

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:59:33 26 4
gpt4 key购买 nike

我是第一次尝试在实际项目中使用 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.3xcode-6 文件夹工作得很好,所以它与我似乎是从 Cocoapods 获得的。

我可以在这里做什么?如果可能的话,我真的宁愿从 Cocoapods 获取它。

最佳答案

根据您使用的 Xcode 版本,需要不同版本的 Realm 核心库,因此在运行 时使用 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 版本。

关于ios - 添加 Realm Cocoapod 时重复符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33125781/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com