Enterprise-distributed app with dynamic Frameworks does not launch without Developer Mode on iOS 16

Any enterprise distributed apps that include dynamic frameworks will not work for us anymore on iOS 16 (not beta!) devices with developer mode disabled. Everytime one of them is launched it will crash and there will be a new added analytics entry that contains something like the following:

["Library not loaded: @rpath\/Alamofire.framework\/Alamofire","Referenced from: <D9D3F975-2965-31EF-85A5-95DA1DC821C4> \/Volumes\/VOLUME\/*\/XXXXX.app\/XXXXX","Reason: tried: '\/usr\/lib\/swift\/Alamofire.framework\/Alamofire' (errno=2, not in dyld cache), '\/private\/preboot\/Cryptexes\/OS\/usr\/lib\/swift\/Alamofire.framework\/Alamofire' (errno=2), '\/private\/var\/containers\/Bundle\/Application\/B4735785-6633-4A6B-B5C1-AE03B47C1758\/XXXXX.app\/Frameworks\/Alamofire.framework\/Alamofire' (code signature invalid in <E8B8B1DE-7DCC-3677-86C1-07E3629482DB> '\/private\/var\/containers\/Bundle\/Application\/B4735785-6633-4A6B-B5C1-AE03B47C1758\/XXXXX.app\/Frameworks\/Alamofire.framework\/Alamofire' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x001400A0, codeBlobSize=0x00007130), '\/private\/var\/containers\/Bundle\/Application\/B4735785-6633-4A6B-B5C1-AE03B47C1758\/XXXXX.app\/Frameworks\/Alamofire.framework\/Alamofire' (code signature invalid in <E8B8B1DE-7DCC-3677-86C1-07E3629482DB> '\/p"]

Additional notes:

  • The functionality of the app does not matter at all. I can create a new Project in XCode 14 and add a framework and it will show this behaviour
  • This happens both for frameworks generated by Cocoapods or ones that I added to the project directly
  • I do not have any specific signing steps that I take, I just archive the app from xcode and then pick distribute app/enterprise in the archive organizer and leave everything to its default values

The only thing that seems to migitate the issue somewhat is disabling manual signing in Xcode and use automatic signing for all steps, but even that only allows the app to launch on some devices while it still crashes on others with no obvious pattern to it

Hello, I came across a similar issue reported here. I also filed a radar with this information and never got an answer. I kept searching for a fix and tried to change the app package name and reached a state where it never prompted for developer mode on a Enterprise App (seems OK) BUT the App kept crashing on startup. While surfing on the device's logs I found the exact same issue you report here, library not loaded for a pod I have been using for years. I removed it tried again and another library start crashing (also from Cocoapods). I cannot migrate all the libraries I have in Cocoapods because most of them don't have a SPM support so it's a bothersome task I'm still trying to investigate how to achieve with the minimum time impact, but the funny thing is I have deployed a version for a demo in one of my colleague's iPhone and it just works! No crash, no error or ask for developer mode enablement so I'm literally perplexed. I have tried this .ipa in three devices, all of then with iOS 16 and the two of them I use for development I can reproduce the crash so either I'm missing something or there's something wrong with development mode or Cocoapods with iOS 16. Did you managed to get this fixed?

Have you ever fixed it? I also came across the same problem. It seems like a system bug on iOS16 that i use two phones updated to latest iOS16, run the same enterprise distibuted app, one crash the other is normal. That is so weird and i do not know what to do next...

I can confirm this is still happening in the current latest version of iOS 16.

I run an Enterprise app setup, all our older hardware models are totally unaffected. I only found out about it because my personal phone is on 16.

If I switch to developer mode, it will run fine.

I did a full rebuild and resign of the application, problem persists.

I even went ahead and upgraded my deployment targets on cocoapods a little bit just to be extra sure.

Still crashing. Could really use some info from Apple here

Enterprise-distributed app with dynamic Frameworks does not launch without Developer Mode on iOS 16
 
 
Q