配置证书后,在iPhone上运行(模拟器运行没有问题),出现故障如下:
dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib Referenced from:
/var/mobile/Containers/Bundle/Application/0C3695BA-B047-4B87-A8F0-47F9ADF1B087/GraphicsPerformance-Starter.app/GraphicsPerformance-Starter
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/0C3695BA-B047-4B87-A8F0-47F9ADF1B087/GraphicsPerformance-Starter.app/Frameworks/libswiftAVFoundation.dylib:
mmap() errno=1 validating first page of
‘/private/var/mobile/Containers/Bundle/Application/0C3695BA-B047-4B87-A8F0-47F9ADF1B087/GraphicsPerformance-Starter.app/Frameworks/libswiftAVFoundation.dylib’
/var/mobile/Containers/Bundle/Application/0C3695BA-B047-4B87-A8F0-47F9ADF1B087/GraphicsPerformance-Starter.app/GraphicsPerformance-Starter
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/0C3695BA-B047-4B87-A8F0-47F9ADF1B087/GraphicsPerformance-Starter.app/Frameworks/libswiftAVFoundation.dylib:
mmap() errno=1 validating first page of
‘/private/var/mobile/Containers/Bundle/Application/0C3695BA-B047-4B87-A8F0-47F9ADF1B087/GraphicsPerformance-Starter.app/Frameworks/libswiftAVFoundation.dylib’
解决方案:
在终端运行:
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Caches/com.apple.dt.Xcode