App crash on iOS 11.0.2, no suitable image found

736 Views Asked by At

dyld: Library not loaded: @rpath/AFNetworking.framework/AFNetworking

Referenced from: /var/containers/Bundle/Application/

Reason: No suitable image found.

3

There are 3 best solutions below

0
On

I had the same issue, in my case the problem was that I had a certificate expired and marked as "always trust". I fixed it using the default setting for the certificates and deleting the expireds

13
On

Explanation of the error:

Your app could not able to find the AFNetworking Dynamic Framework in @rPath. This is the place (rPath), where we should need to place our third party or our custom Dynamic Frameworks for the system to search for Dynamic Frameworks. So that system will search the rPath folder and will load them lazily instead of statically.

Solution:

If you are using Cocoapods, then cocoapods will itself do this step for you. Let me know if you are not using Cocoapods. If you still face the problem, just run Pod install once again..

enter image description here

if you are building your own libraries then you should place them in embedded binaries.

enter image description here

0
On

It seems what you are using in AFNetworking is iOS11+, yet you've required it for your project, so when iOS10 searches its directories to find it, it finds nothing. The fact that the error says 'image' is just a fault on Apple's end.

Fix:

Under your project settings go to included frameworks, find AFNetworking and set the status flag from required to optional. Then, wherever you would use AFNetworking in your project, wrap it in the following:

if (@available(iOS 11.0, *)) {
    //your AFNetworking code here (for iOS11+)
} else {
    //comparable non-AFNetworking code here (for iOS10-)
}

Or just make your project require iOS11 under the deployment target flag.