gpt4 book ai didi

ios - 无法加载 UITests 包,因为它已损坏或缺少必要的资源。尝试重新安装 bundle

转载 作者:IT王子 更新时间:2023-10-29 04:58:58 26 4
gpt4 key购买 nike

由于以下错误,我无法运行我的测试用例:

  • 无法加载“UITests”包,因为它已损坏或缺少必要的资源。尝试重新安装 bundle 。
  • 库未加载:@rpath/Alamofire.framework/Alamofire。
  • 原因:找不到图片

这两天尝试搜索和解决,但无法解决此问题,请有人帮忙。

最佳答案

我能够使用 Xcode 10.1 生成的项目重现此问题。我使用 Swift 4.2 和 CocoaPods 1.10.0 作为依赖项管理器。我有以下 Podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'

target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

# Pods for MyApp
pod 'Alamofire', '4.8.1'

target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end

target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end

end

然后我删除了 use_frameworks!,参见 this link了解更多详情:

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'

target 'MyApp' do

# Pods for MyApp
pod 'Alamofire', '4.8.1'

target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end

target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end

end

我也收到了一些这样的警告:

[!] The `MyAppUITests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-MyApp-MyAppUITests/Pods-MyApp-MyAppUITests.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

这就是我从 MyAppUITests build设置中删除这一行的原因:

MyAppUITests build settings

之后运行 pod deintegrate && pod install 然后问题就消失了。可能对于具有更多依赖项的项目(如 here ),您需要使用其他解决方案。

关于ios - 无法加载 UITests 包,因为它已损坏或缺少必要的资源。尝试重新安装 bundle ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40480503/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com