7

我正在尝试在 iOS8 设备上运行 Kiwi(通过 CocoaPods 安装)测试,但构建失败并出现以下链接错误:

ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/XCTest, missing required architecture armv7 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks/XCTest.framework/XCTest (2 slices)
Undefined symbols for architecture armv7:
  "_OBJC_METACLASS_$_XCTestSuite", referenced from:
      _OBJC_METACLASS_$__KWAllTestsSuite in libPods-TestTests.a(KWAllTestsSuite.o)
  "_OBJC_CLASS_$_XCTestSuite", referenced from:
      _OBJC_CLASS_$__KWAllTestsSuite in libPods-TestTests.a(KWAllTestsSuite.o)
      objc-class-ref in libPods-TestTests.a(KWAllTestsSuite.o)
      l_OBJC_$_CATEGORY_XCTestSuite_$_KWConfiguration in libPods-TestTests.a(KWAllTestsSuite.o)
  "_OBJC_METACLASS_$_XCTestCase", referenced from:
      _OBJC_METACLASS_$_TestTests in TestTests.o
      _OBJC_METACLASS_$_KWSpec in libPods-TestTests.a(KWSpec.o)
  "_OBJC_CLASS_$_XCTestCase", referenced from:
      _OBJC_CLASS_$_TestTests in TestTests.o
      _OBJC_CLASS_$_KWSpec in libPods-TestTests.a(KWSpec.o)
  "__XCTFailureHandler", referenced from:
      -[TestTests testExample] in TestTests.o
  "__XCTFailureFormat", referenced from:
      -[TestTests testExample] in TestTests.o
  "_OBJC_EHTYPE_$__XCTestCaseInterruptionException", referenced from:
  GCC_except_table2 in TestTests.o
ld: symbol(s) not found for architecture armv7

测试正在每个可用的模拟器上构建和运行。没有 Kiwi 的 XCTest 测试也在 iOS 8 设备上构建并成功运行。

编辑 31.10删除了测试项目的链接

4

2 回答 2

5

尝试添加$(PLATFORM_DIR)/Developer/Library/Frameworks到项目的构建设置 => 框架搜索路径

在此处输入图像描述

于 2014-09-30T10:28:55.597 回答
1

添加-framework XCTestOther Linker Flags您的 xcode 项目中

于 2015-06-23T05:44:55.980 回答