我已经开始为我的应用程序编写单元测试。运行测试类(XCTest)后,构建成功,但测试因另一个目标的框架链接问题而失败。另一个目标本身正在成功构建和测试。
我已经尝试了互联网上提供的所有解决方案,但这些建议都无法解决我的问题。简而言之,我尝试过使用继承在 Podfile 中设置测试目标! :完成,将框架设置为可选,启用“构建选项”下的“始终嵌入 Swift 标准库”选项,选中 IOS 部署目标等。
Logs are following: The bundle “CheckoutTests” couldn’t be loaded because it is damaged or missing necessary resources.
Try reinstalling the bundle. dlopen_preflight(/Users/..../Debugiphonesimulator/CheckoutTests.xctest/CheckoutTests): Library not loaded:@rpath/CleverTapSDK.framework/CleverTapSDK.
Referenced from: /Users/.../DerivedData/.../Debug-iphonesimulator/CustomerAnalytics.framework/CustomerAnalytics.
Reason: image not found)
Program ended with exit code: 82
**Podfile:**
>target 'Checkout' do
> project 'Projects/Checkout/Checkout.xcodeproj'>>
pod 'SDWebImage', '3.8.2'
target 'CheckoutTests' do
inherit! :complete
end
end
我想在没有任何框架链接问题的情况下运行测试通过。
最佳答案
看起来您的框架没有复制到适当的目标中。检查构建阶段并确保将构建的框架复制到目标输出包中。
关于ios - 无法加载 bundle “CheckoutTests”,因为它已损坏或缺少必要的资源。尝试重新安装 bundle ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57349483/