我有一个Xcode工作区,我已经更新到KIF 2.0(通过pod文件中的终端和pod'KIF'进行pod更新)之后我按照https://github.com/kif-framework/KIF#configure-the-testing-target(installation中提供的说明配置了工作区Cocoapods部分)。但是当我尝试执行项目以及运行我的测试目标时,它会抛出错误,
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我还检查过此链接:https://groups.google.com/forum/#!msg/kif-framework/EilvCp2psZA/huUQ3sGpmwQJ。但问题仍然存在。
我该如何纠正?屏幕截图如下所示。
当我尝试使用iPhone 5运行它时,它会显示5个链接器错误,例如
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit, missing required architecture armv7s in file /Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit (2 slices)
Undefined symbols for architecture armv7s:
"_OBJC_METACLASS_$_SenTestCase", referenced from:
_OBJC_METACLASS_$_KIFTestCase in libPods.a(KIFTestCase.o)
"_OBJC_CLASS_$_SenTestCase", referenced from:
_OBJC_CLASS_$_KIFTestCase in libPods.a(KIFTestCase.o)
l_OBJC_$_CATEGORY_SenTestCase_$_KIFAdditions in libPods.a(SenTestCase-KIFAdditions.o)
"_SenTestToolKey", referenced from:
+[KIFTestActor load] in libPods.a(KIFTestActor.o)
"_SenSelfTestMain", referenced from:
+[KIFTestActor load] in libPods.a(KIFTestActor.o)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
答案 0 :(得分:3)
与最新的可可豆荚版本相同。
您可以按照以下步骤解决此问题:
答案 1 :(得分:2)
转到目标设置并添加SenTestingKit以将二进制文件链接到库。
答案 2 :(得分:1)
我可以删除XCTest框架。我知道这可能是你不想做的事情。
答案 3 :(得分:0)
我在同事的帮助下解决了这个问题。 两个步骤: 1,只需将cocoapods更新为0.29.0,因为0.29.0只修复了一个bug,更多细节,请参阅: https://github.com/CocoaPods/CocoaPods/issues/1558 使用命令: sudo gem安装cocoapods pod安装 pod更新 2,如果你想在ios设备上运行你的应用程序,只需将Build Settings-> Architectures,它的值改为(标准架构(armv7,armv7s)),