最近我开始为一个旧的静态库编写测试用例。我已经将库加载到 Xcode 5,因为静态库很旧,我必须手动添加带有测试目标的 TestProject。
当我尝试“Product-->Test”时,它启动模拟器并且控制台显示以下错误
The test bundle at /xxx/xxx/xxx/StaticLibTest.xctest could not be
loaded because an unanticipated error occurred: Error
Domain=NSCocoaErrorDomain Code=3587 "The bundle “StaticLibTest.xctest”
couldn’t be loaded because it is damaged or missing necessary
resources."
(dlopen_preflight(/xxx/xxxx/xxx/Debug-iphonesimulator/StaticLibTest.xctest/StaticLibTests):
no suitable image found. Did find:
我不知道为什么会出现这个错误。
任何指出正确方向的帮助将不胜感激。
最佳答案
如果其他读者遇到此错误,而您正在使用 Carthage 添加框架,请确保 Copy Files
阶段使用 Destination: Frameworks。
如果您不小心将框架添加到具有不同目标(框架除外)的Copy Files
阶段,或Copy Bundle Resources
,这也会产生损坏的/无效的包错误消息。
关于ios - 无法加载测试包,因为出现意外错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25079775/