问题描述
我有一个Xcode工作区,我已经更新到KIF 2.0(通过pod文件中的终端和pod'KIF'进行pod更新)之后我按照)。但是当我尝试执行项目以及运行我的测试目标时,它会抛出错误,
ld:为iOS模拟器构建,但是为针对MacOSX文件构建的dylib链接'/Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit'用于体系结构i386
clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
我有还检查了以下链接:。但问题仍然存在。
我该如何纠正?屏幕截图如下所示。
ld:警告:忽略文件/应用程序/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit,缺少文件中所需的架构armv7s /Applications/Xcode.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit(2片)
架构armv7s的未定义符号:
_ OBJC_METACLASS _ $ _ SenTestCase,引用自:
_OBJC_METACLASS _ $ _ _ KIFTestCase in libPods.a(KIFTestCase.o)
_OBJC_CLASS _ $ _ SenTestCase,引用自:
_OBJC_CLASS _ $ _ KIFTestCase in libPods.a(KIFTestCase.o)
l_OBJC _ $ _ CATEGORY_SenTestCase _ $ _ KIFAdditions in libPods.a(SenTestCase-KIFAdditions.o)
_SenTestToolKey,引自:$ b libPods.a中的$ b + [KIFTestActor load](KIFTes tActor.o)
_SenSelfTestMain,引自:
+ libPods.a中的[KIFTestActor load](KIFTestActor.o)
ld:找不到架构armv7s $ b的符号$ b clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
此处与最新的可可豆荚版本相同。
您可以按照以下步骤解决此问题:
- 选择Pods项目
- 点击构建设置
- 仅将构建活动架构更改为否
I have an Xcode workspace in which I have updated to KIF 2.0(pod update via terminal & pod 'KIF' in the podfile) after that I have configured the workspace as per the instructions provided in https://github.com/kif-framework/KIF#configure-the-testing-target(installation with Cocoapods section).But when I tried to execute the project as well as Run my test target it throws an error,
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)
I have also checked this link:https://groups.google.com/forum/#!msg/kif-framework/EilvCp2psZA/huUQ3sGpmwQJ . But still the issue persists.
How can I correct it? The screen shot is provided below.
When I tried to Run it using iPhone 5 it shows 5 linker error such as
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)
Same issue here with the latest cocoa pods version.
You can solve this by following this steps:
- Select the Pods project
- Click on build settings
- Change Build Active Architecture Only to 'No'
这篇关于在通过cocoapods更新KIF框架后运行以及测试Xcode工作区时出现链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!