Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Recently I've been sent sources of the app I need to build and deploy to TestFlight. Unfortunatly whenever I try to run the app on my test device in debug mode or the one installed from TestFlight, it fails to start throwing the following error message:

dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire
  Referenced from: /var/containers/Bundle/Application/77FB1F81-25F5-4670-ACF1-F814543B9A0E/MyApp.app/MyApp
  Reason: no suitable image found.  Did find:
    /private/var/containers/Bundle/Application/77FB1F81-25F5-4670-ACF1-F814543B9A0E/MyApp.app/Frameworks/Alamofire.framework/Alamofire: code signing blocked mmap() of '/private/var/containers/Bundle/Application/77FB1F81-25F5-4670-ACF1-F814543B9A0E/MyApp.app/Frameworks/Alamofire.framework/Alamofire'
    /private/var/containers/Bundle/Application/77FB1F81-25F5-4670-ACF1-F814543B9A0E/MyApp.app/Frameworks/Alamofire.framework/Alamofire: code signing blocked mmap() of '/private/var/containers/Bundle/Application/77FB1F81-25F5-4670-ACF1-F814543B9A0E/MyApp.app/Frameworks/Alamofire.framework/Alamofire'
    /private/var/containers/Bundle/Application/77FB1F81-25F5-4670-ACF1-F814543B9A0E/MyApp.app/Frameworks/Alamofire.framework/Alamofire: code signing blocked mmap() of '/private/var/containers/Bundle/Application/77FB1F81-25F5-4670-ACF1-F814543B9A0E/MyApp.app/Frameworks/Alamofire.framework/Alamofire'

The app uses COCOAPODS as a dependency manager. In the Podfile there's TRON pod which depends on Alamofire framework we have problem with. The app built, signed and validated successfully during submission and debug builds. So it doesn't seem to be related to certificates or provision profiles. But I've anyway recreated certificates and provision profiles. (although I believe this is not the case as the app is submitted to app store successfully). Developer of the app builds and runs the app with no problem. We checked the versions of used tools and libraries and they seem to be indentical. (xcode version, cocoapods version, pods dependencies). I even tried to build the sources with all dependencies installed (pod install), that he builds.

There're similar questions on SO, but they don't seem to deal with COCOAPODS when they face this problem. The solution is usually involves manually Embedding frameworks. But this is not the approriate solution for us, as all demendencies integrated through COCOAPOD scripts.

What else can cause the problem?

like image 973
mra214 Avatar asked Oct 12 '17 08:10

mra214


3 Answers

This is an issue with iOS 13.3.1. All dynamic frameworks being compiled to the newest release of iOS 13.3.1 are experiencing this issue when running on a personal provisioning profile/developer account.

You can:

Use a non-Personal Team provisioning profile (paid developer account). Run on the 13.3.1 simulator. Test on a real iOS device running 13.3 or lower. This issue will be fixed in 13.4 Beta version though.

like image 78
mAc Avatar answered Nov 20 '22 04:11

mAc


The problem was not related to specific app. Building any app even the most simple one produced the same error.

Solved by reinstalling Apple Worldwide Developer Relations Certification Authority, even though it wasn't expired.

Steps:

  1. Open Keychain Access
  2. Remove the certificate from Login and System Keychains
  3. Download certificate from https://developer.apple.com/certificationauthority/AppleWWDRCA.cer and install it to both keychains. (double click it)

JIC: Remove provision profiles, clean project, restart xcode/Mac :-)

like image 29
mra214 Avatar answered Nov 20 '22 04:11

mra214


in my case, the problem was related to Apple Worldwide Developer Relations Certification Authority and i solve it by change trust from always to use system defaults.

  • open keychain access
  • right click on Apple Worldwide Developer Relations Certification Authority and select Get Info
  • Expand trust
  • change when using this certificate to use system defaults
like image 1
Monir Khlaf Avatar answered Nov 20 '22 03:11

Monir Khlaf