微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

框架 – MacOS Swift框架测试失败

我有一个用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”

可能不是一个好的最终解决方案,但它适用于临时.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐