How to run an iOS app that causes runtime error for frameworks "code signature invalid"

Aidan Rosswood picture Aidan Rosswood · Feb 1, 2020 · Viewed 12.3k times · Source

Every time I try to run this application it builds OK and installs, but as soon as it runs, the application breaks and prints this error message:

dyld: Library not loaded: @rpath/StandardCyborgFusion.framework/StandardCyborgFusion
  Referenced from: /private/var/containers/Bundle/Application/2292CCF2-800F-4E28-AF10-A1B98081DD0A/StandardCyborgExample.app/StandardCyborgExample
  Reason: no suitable image found.  Did find:
    /private/var/containers/Bundle/Application/2292CCF2-800F-4E28-AF10-A1B98081DD0A/StandardCyborgExample.app/Frameworks/StandardCyborgFusion.framework/StandardCyborgFusion: code signature invalid for '/private/var/containers/Bundle/Application/2292CCF2-800F-4E28-AF10-A1B98081DD0A/StandardCyborgExample.app/Frameworks/StandardCyborgFusion.framework/StandardCyborgFusion'

I saw many similar posts here and on the App Developer forums about this problem but no one has an explanation or a valid fix.

I tried:

  • Cleaning and building
  • Restarting XCode
  • Restarting the Mac
  • Completely resetting Keychain
  • Verifying all Keychain certs Trust settings are on "Use System Defaults"
  • Factory resetting my Mac

It appears to be an issue with my iOS device. The application can start on a simulator, but the simulator is not good for my development purposes so I need to make this work on my device. I recently updated my iPhone XR to iOS 13.3.1.


"Running new app on actual iOS (13.3.1) device crashes on startup: code signature invalid for "path/to/Flutter.framework/Flutter" #49504" seems to be the same issue.

I'm using XCode 11 and iOS 13.

Answer

Aidan Rosswood picture Aidan Rosswood · Feb 6, 2020

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 run on a personal provisioning profile/developer account. The solution, copied from jmagman from Github, is below.

You can:

  1. Use a non-Personal Team provisioning profile (paid developer account).
  2. Run on the 13.3.1 simulator.
  3. Test on a real iOS device running 13.3 or lower.
  4. Install the beta profile on your test device and install iOS 13.4 beta 3. (Fixed)
  5. Wait for iOS 13.4 to be released.

Hopefully this issue will be fixed soon.