当我尝试将 XCTest 与 Cordova 项目集成时出现错误。它发生在一个新的科尔多瓦应用程序中,没有自定义。只需添加 XCTest 并测试失败并出现以下错误:
Undefined symbols for architecture i386:
"_CGRectZero", referenced from:
+[CDVUserAgentUtil originalUserAgent] in libCordova.a(CDVUserAgentUtil.o)
"_OBJC_CLASS_$_ALAssetsLibrary", referenced from:
objc-class-ref in libCordova.a(CDVURLProtocol.o)
"_OBJC_CLASS_$_CLLocation", referenced from:
l_OBJC_$CATEGORY_CLLocation$_JSONMethods in libCordova.a(CDVShared.o)
"_UTTypeCopyPreferredTagWithClass", referenced from:
___30-[CDVURLProtocol startLoading]_block_invoke in libCordova.a(CDVURLProtocol.o)
"_kUTTagClassMIMEType", referenced from:
___30-[CDVURLProtocol startLoading]_block_invoke in libCordova.a(CDVURLProtocol.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我尝试删除 i386 架构,但无济于事,还有很多其他的东西,但这个正在逃避我。
有什么想法吗?提前致谢!
编辑:我忘了注意项目构建得非常好,但是运行测试[通过产品->测试]会导致这些错误。