iOS开发 app 真机测试报错 dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib

我平时都喜欢真测试,很少运行模拟器,今天启动app时报错:

 

dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib

  Referenced from: /var/containers/Bundle/Application/0AF0D7B1-E55F-406E-93F8-66E7F5B6CFA1/XXX.app/XXX

  Reason: no suitable image found.  Did find:

/private/var/containers/Bundle/Application/0AF0D7B1-E55F-406E-93F8-66E7F5B6CFA1/XXX.app/Frameworks/libswiftAVFoundation.dylib: code signature invalid for '/private/var/containers/Bundle/Application/0AF0D7B1-E55F-406E-93F8-66E7F5B6CFA1/XXX.app/Frameworks/libswiftAVFoundation.dylib'


/private/var/containers/Bundle/Application/0AF0D7B1-E55F-406E-93F8-66E7F5B6CFA1/XXX.app/Frameworks/libswiftAVFoundation.dylib: code signature invalid for '/private/var/containers/Bundle/Application/0AF0D7B1-E55F-406E-93F8-66E7F5B6CFA1/XXX.app/Frameworks/libswiftAVFoundation.dylib'



/private/var/containers/Bundle/Application/0AF0D7B1-E55F-406E-93F8-66E7F5B6CFA1/XXX.app/Frameworks/libswiftAVFoundation.dylib: stat() failed with errno=1

/private/var/containers/Bundle/Application/0AF0D7B1-E55F-406E-93F8-66E7F5B6CFA1/XXX.app/Frameworks/libswiftAVFoundation.dylib: code signature invalid for '/private/var/containers/Bundle/Application/0AF0D7B1-E55F-406E-93F8-66E7F5B6CFA1/XXX.app/Frameworks/libswiftAVFoundation.dylib'



/private/var/containers/Bundle/Application/0AF0D7B1-E55F-406E-93F8-66E7F5B6CFA1/XXX.app/Frameworks/libswiftAVFoundation.dylib: stat() failed with errno=1

(lldb)

 

解决方法:

  • 找到Build Setings 在右上角搜索swift将 Always Embed Swift Standard Libraries属性改为YES,具体这个属性是什么意思,没有找到太多的解析,就按字面意思理解吧!

 

iOS开发 app 真机测试报错 dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib_第1张图片

  • 重启电脑->重启Xcode->(command+shift+k)也就是clean一下
  • ~/资源库/Caches/com.apple.dt.Xcode 删掉 com.apple.dt.Xcode文件
  • ~/资源库/Developer/Xcode/DerivedData 删掉文件夹内的所有文件(我就在这成功解决了!!!)

 

你可能感兴趣的:(技术,移动开发)