不知道为什么报告FBSnapshotTestCase image not found while running Xcode test。
我试图将FBSnapshotTestCase链接到目标ChartTests中,但仍然看到了相同的错误。
我对此不熟悉,有人能帮忙吗?提前谢谢。
复制:
从https://github.com/danielgindi/Charts下载该项目
导航到项目根目录,
carthage bootstrap安装依赖项。该项目有一个依赖项检查,所以如果您不运行它,它将在启动测试时运行它。目标id可以是机器上模拟器的任何uuid。
然后报告说:
2017-04-20 13:47:57.611 xctest[90924:13099756] The bundle “ChartsTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2017-04-20 13:47:57.611 xctest[90924:13099756] (dlopen_preflight(/Users/user/Library/Developer/Xcode/DerivedData/Charts-ambsdrskvocwekcmoobyhanaiixm/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ChartsTests.xctest/ChartsTests): Library not loaded: @rpath/FBSnapshotTestCase.framework/FBSnapshotTestCase
Referenced from: /Users/user/Library/Developer/Xcode/DerivedData/Charts-ambsdrskvocwekcmoobyhanaiixm/Build/Intermediates/CodeCoverage/Products/Debug-iphonesimulator/ChartsTests.xctest/ChartsTests
Reason: image not found)
2017-04-20 13:47:57.625 xcodebuild[90311:13086990] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
Testing failed:
Test target ChartsTests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **发布于 2017-04-21 06:47:06
结果,我需要在构建阶段添加运行脚本,并让carthage复制框架:
从https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos复制
在应用程序目标的“构建阶段”设置选项卡上,单击“+”图标并选择“新建运行脚本阶段”。创建一个运行脚本,在其中指定shell (ex: /bin/sh),将以下内容添加到shell下面的脚本区域:
/usr/local/bin/carthage copy-frameworks并将路径添加到您希望在“输入文件”下使用的框架中,例如:
$(SRCROOT)/Carthage/Build/iOS/FBSnapshotTestCase.frameworkhttps://stackoverflow.com/questions/43532547
复制相似问题