真机调试App报Library Not Loaded....Reason: no suitable image found. Did find:错误

原文解决办法在这里:真机调试APP时报dyld: Library not loaded: @rpath/XXX等错误**
谢谢博主黑暗中的孤影

我在下载证书之后,在keyChain里面把证书设置为始终信任,如图:

真机调试App报Library Not Loaded....Reason: no suitable image found. Did find:错误_第1张图片
Paste_Image.png

提示:此证书的签发者无效

因此,我修改证书为始终信任:


真机调试App报Library Not Loaded....Reason: no suitable image found. Did find:错误_第2张图片
Paste_Image.png

结果在运行的时候,编译通过, 但程序在启动的时候,程序直接崩溃,显示如下:

dyld: Library not loaded: @rpath/AFNetworking.framework/AFNetworking
  Referenced from: /var/mobile/Containers/Bundle/Application/BD8D7CF1-5E24-4B92-A300-70E28C82C1BA/text1.app/text1
  Reason: no suitable image found.  Did find:
 /private/var/mobile/Containers/Bundle/Application/BD8D7CF1-5E24-4B92-A300-70E28C82C1BA/text1.app/Frameworks/AFNetworking.framework/AFNetworking: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/BD8D7CF1-5E24-4B92-A300-70E28C82C1BA/text1.app/Frameworks/AFNetworking.framework/AFNetworking'
 /private/var/mobile/Containers/Bundle/Application/BD8D7CF1-5E24-4B92-A300-70E28C82C1BA/text1.app/Frameworks/AFNetworking.framework/AFNetworking: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/BD8D7CF1-5E24-4B92-A300-70E28C82C1BA/text1.app/Frameworks/AFNetworking.framework/AFNetworking'
 /private/var/mobile/Containers/Bundle/Application/BD8D7CF1-5E24-4B92-A300-70E28C82C1BA/text1.app/Frameworks/AFNetworking.framework/AFNetworking: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/BD8D7CF1-5E24-4B92-A300-70E28C82C1BA/text1.app/Frameworks/AFNetworking.framework/AFNetworking'
(lldb)

这个是我的截图:


真机调试App报Library Not Loaded....Reason: no suitable image found. Did find:错误_第3张图片
Paste_Image.png

最后我把证书改成系统默认就可以了...

真机调试App报Library Not Loaded....Reason: no suitable image found. Did find:错误_第4张图片
Paste_Image.png

再次编译运行, success

你可能感兴趣的:(真机调试App报Library Not Loaded....Reason: no suitable image found. Did find:错误)