当试图在我的设备上运行UI测试时,我会得到以下错误:
XCTRunner1476:104021包“AppUITests”无法加载,因为它已经损坏或缺少必要的资源。试着重新安装包。2015年-11-23 20:58:53.903 XCTRunner1476:104021
在本例中,它是"UIColor_Hex_Swift.framework",在我的podfile中。但是,从cocoapods加载哪些框架并不重要。它在每个框架上都会失败。
我尝试过更改pod文件、清理、删除派生数据、重新安装荚和更改签名。不,我没有主意了。
如果我用模拟器的话一切都很好。
这是我的豆荚文件:
platform :ios, '9.0'
workspace './AppWorkspace'
use_frameworks!
inhibit_all_warnings!
link_with 'App', 'AppTests', 'AppUITests'
target 'App', :exclusive => false do
pod 'SwiftyJSON', '~> 2.3.0'
pod 'MQTTKit', :git => 'https://github.com/mobile-web-messaging/MQTTKit.git'
pod 'PromiseKit', '~> 3.0.0'
pod 'UIColor_Hex_Swift',:git => 'https://github.com/yeahdongcn/UIColor-Hex-Swift.git', :branch => 'Swift-2.0'
pod 'OHHTTPStubs', '~> 4.3.0'
pod 'Alamofire', '~> 3.1.0'
end
def testing_pods()
# pod 'SwiftyJSON', '~> 2.3.0'
# pod 'MQTTKit', :git => 'https://github.com/mobile-web-messaging/MQTTKit.git'
# pod 'PromiseKit', '~> 3.0.0'
pod 'UIColor_Hex_Swift',:git => 'https://github.com/yeahdongcn/UIColor-Hex-Swift.git', :branch => 'Swift-2.0'
# pod 'OHHTTPStubs', '~> 4.3.0'
# pod 'Alamofire', '~> 3.1.0'
end
target 'AppTests', :exclusive => false do
testing_pods
end
target 'AppUITests', :exclusive => false do
testing_pods
end发布于 2016-10-17 15:31:06
仅供参考,对我有用的解决方案就是在测试目标中手动设置主机应用程序

发布于 2019-12-12 14:34:34
正在改变,
目标->构建设置-> ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES ->值(布尔值)到$(继承)。
然后就获得了建造的成功。
https://stackoverflow.com/questions/33879799
复制相似问题