我有一个用obj-c和
swift编写的框架.
现在我尝试运行相关的单元测试目标,但是我收到此错误:
2014-07-10 07:45:54.064 xctest[4908:303] The test bundle at /Users/steve/Temporary/Build/Products/Debug/SOGraphDB-Mac Tests.xctest could not be loaded because an unanticipated error occurred: Error Domain=NSCocoaErrorDomain Code=3587 "The bundle “SOGraphDB-Mac Tests” couldn’t be loaded because it is damaged or missing necessary resources." (dlopen_preflight(/Users/steve/Temporary/Build/Products/Debug/SOGraphDB-Mac Tests.xctest/Contents/MacOS/SOGraphDB-Mac Tests): Library not loaded: @rpath/libswiftAppKit.dylib Referenced from: /Users/steve/Temporary/Build/Products/Debug/SOGraphDB.framework/Versions/A/SOGraphDB Reason: image not found) UserInfo=0x10011c640 {NSLocalizedFailureReason=The bundle is damaged or missing necessary resources.,NSLocalizedRecoverySuggestion=Try reinstalling the bundle.,NSFilePath=/Users/steve/Temporary/Build/Products/Debug/SOGraphDB-Mac Tests.xctest/Contents/MacOS/SOGraphDB-Mac Tests,NSDebugDescription=dlopen_preflight(/Users/steve/Temporary/Build/Products/Debug/SOGraphDB-Mac Tests.xctest/Contents/MacOS/SOGraphDB-Mac Tests): Library not loaded: @rpath/libswiftAppKit.dylib Referenced from: /Users/steve/Temporary/Build/Products/Debug/SOGraphDB.framework/Versions/A/SOGraphDB Reason: image not found,NSBundlePath=/Users/steve/Temporary/Build/Products/Debug/SOGraphDB-Mac Tests.xctest,NSLocalizedDescription=The bundle “SOGraphDB-Mac Tests” couldn’t be loaded because it is damaged or missing necessary resources.}
知道根本原因是什么吗?
该错误似乎与“未加载库:@ rpath / libswiftAppKit.dylib”有关
两者(框架和测试包)编译时没有任何错误或警告(在Beta2中)
我有同样的问题.
结束了将libswiftAppKit.dylib从Xcode应用程序目录(我正在使用beta 3)复制到我可以引用的目录(不是应用程序包的一部分),然后将库添加到“Link binary with libraries”设置中测试包.我的测试然后开始工作.
仅供参考,对于dylib的路径是在“/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftAppKit.dylib”
可能不是一个好的最终解决方案,但它适用于临时.