dyld: Library not loaded. Reason : no suitable image found dyld: Library not loaded. Reason : no suitable image found xcode xcode

dyld: Library not loaded. Reason : no suitable image found


I came across this issue today and resolved it the same way. Revoke and regenerate code signing solves this issue. But to shed some light on the "why" part of it.

Apple went ahead and changed the certificate contents. To be more precise, it added a new "OU" (organizational unit) field under Subject. By revoking and regenerating the code signing, it added the missing field and the problems went away.


Incase this helps anyone, none of the solutions I kept finding on the web were working for me. Pulled my hair our for 2 days, and tried everything. I revoked in-house cert, new provisioning profile, added files to embedded, etc.

Could not for the life of me figure out what was wrong until I noticed that in Keychain access my Apple WWDR and iOS Distributions certs were being set to "Always Trust" instead of "Use Systems Default". Switched my certs back to "Use Systems Defaults" and everything went back to working as it should. I have no idea why and how this works but it did.


It turns out that Xcode cache some device specific stuff which can get mixed up if you are running your apps on multiple devices. The simple fix is to delete Xcode cache. The following command clean it up for you

rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"rm -rf ~/Library/Developer/Xcode/DerivedDatarm -rf ~/Library/Caches/com.apple.dt.Xcode