YIem`s Blog -心比天高命比纸薄-链接找不到的请在站内搜索内容！ - 自动化打包
type: channel
link: https://yiem.net/tag/%E8%87%AA%E5%8A%A8%E5%8C%96%E6%89%93%E5%8C%85/
items: 记录一个UITests Failed 的问题：The bundle “XXXUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.

记录一个UITests Failed 的问题：The bundle “XXXUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
type: item
date: 2020-07-01T11:04:00+08:00
description: 记录一个UITests Failed 的问题：The bundle “XXXUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.环境Mac OS: 10.15.5 Xcode: Version 11.5 (11E608c) CocoaPod: 1.9.3具体log~ - Running tests... ~ The bundle “XXXUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. ~ ( dlopen_preflight (/Users/xxx/Library/Developer/Xcode/DerivedData/XXX-fmdyesowgzsltadmwckhyobwzodi/Build/Products/Debug-iphonesimulator/XXXUITests-Runner.app/PlugIns/XXXUITests.xctest/XXXUITests): Library not loaded: @rpath/AFNetworking.framework/AFNetworking Referenced from: /Users/xxx/Library/Developer/Xcode/DerivedData/XXX-fmdyesowgzsltadmwckhyobwzodi/Build/Products/Debug-iphonesimulator/XXXUITests-Runner.app/PlugIns/XXXUITests.xctest/XXXUITests Reason: image not found)问题过程在进行FastLane自动化过程中，使用自动屏幕快照过程中，需要写测试用例。所以问题就出现了！问题原因项目是混编的项目，其中有Swift，然后就涉及到了Swift历史问题，静态库与动态库的问题。解决方案Podfile文件中， 方案一：将use_frameworks! 删除 方案二：将use_frameworks! 替换为 use_modular_headers!一直没有关过CocoaPods有什么新特性，这就掉坑了！参考链接 https://stackoverflow.com/questions/40480503/the-bundle-uitests-couldn-t-be-loaded-because-it-is-damaged-or-missing-necessary/52355417#52355417 https://stackoverflow.com/questions/41210249/why-do-we-use-use-frameworks-in-cocoapods/49469205#49469205 https://stackoverflow.com/questions/54365549/the-bundle-uitests-couldn-t-be-loadedbecause-it-is-damaged-or-missing-necessary