We’re having some strange issue with our app and/or Testflight since a few days ago: our app runs fine on simulator and devices (iOS 12, iOS 14 & iOS 15) when run from Xcode, but it crashed at launch when we archive and distribute it via Testflight for iOS 14 and below, but NOT for iOS 15 (we haven’t tried to actually release to the AppStore).
The app was working perfectly fine on iOS 12+ until then, on Testflight or otherwise.
No crash log is ever generated by these crashes (either on Crashlytics, or Organizer, or even in the device crash logs), and what’s more mysterious is that when re-archiving past versions of the code that had no issues 3 weeks ago and are live on the app store, we are now getting the crashes.
We’ve dug into the device logs to try and get some more info, and we could find
com.apple.stability.crash {"appVersion":"3.3.1","bundleID":"com.cobble.ios","exceptionCodes":"0x0000000000000000, 0x0000000000000000","incidentID":"B47DF725-343B-4D8E-A1C4-8F52EB5766C1","logwritten":1,"process":"Cobble Production","terminationReasonExceptionCode":"0x1","terminationReasonNamespace":"DYLD"}
for iOS 14, and
Process exited: <FBApplicationProcess: 0x10a2dd110; Cobble Producti (com.cobble.ios); pid: -1> -> <FBApplicationProcessExitContext: 0x28331a100; exitReason: (none); terminationReason: (none)> {
stateAtExit = <FBProcessState: 0x283cd8cc0; pid: 4156; taskState: Not Running; visibility: Unknown>;
}
for iOS 12.
We haven’t had any luck so far figuring out what the issue(s) can be, but we’ve tried a lot of things from building on different computers, playing around in the build settings, updating our pods, to fully uninstalling/reinstalling Xcode and the project from Github..
It might be worth noting that we’re using automatic signing from Xcode (changing that is our next test)
Any help would be greatly appreciated!!
4
Answers
We've ended up finding a solution for our issue:
I don't know if this is going to be the solution for everybody, so here are a couple of links we've used to get some ideas:
Also wanted to add to the things we've tested while debugging:
At the end of the day, it does look like an Apple issue and we would expect to see a fix soon - especially since more and more people have been faced with a similar problem.
I got this working. I used an older version of Xcode (12.5.1) to archive a build. New build (archived from older version of Xcode) from TestFlight is working on iOS 14+ and iOS 15+.
Basically, there is a reference to the new swift concurrency likely in a third party library of your application in use.
See these threads for details:
https://forums.swift.org/t/app-distributed-via-testflight-crashes-on-launch/53936/6 and on apple forums https://developer.apple.com/forums/thread/696197
3 official work arounds:
The resulting crash would look something like this:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Description: DYLD, dyld: Using shared cache: A194BE38-C853-3272-8F62-1028DD9E9B9B | dependent dylib ‘@rpath/libswift_Concurrency.dylib’ not found for ‘/private/var/containers/Bundle/Application/869587C8-912F-4A90-93DC-F5C6B531AC13/Her.app/Her’, tried but didn’t find: ‘/usr/lib/swift/libswift_Concurrency.dylib’ ‘/private/var/containers/Bundle/Application/869587C8-912F-4A90-93DC-F5C6B531AC13/Her.app/Frameworks/libswift_Concurrency.dylib’ ‘@rpath/libswift_Concurrency.dylib’ ‘/usr/local/lib/libswift_Concurrency.dylib’ ‘/usr/lib/libswift_Concurrency.dylib’
Highlighted by Thread: 0
You can find the crash log via Settings -> Privacy -> Analytics & Improvements -> Analytics Data since you won’t be able to get it anywhere else or get the device logs when connected to xcode with physical device and it goes through the crash.
In our case we had already supported just iOS 14+. In our case app suddently start crashing on one Bitrise build where no change was even committed. So maybe Bitrise increased its Xcode patch nubmer?
However, using Xcode 13.2 RC didn’t help in our case since TestFlight didn’t accept it as it was built with unknown version of SDK. Our CI/CD tool Bitrise also didn’t support building using Xcode 13.2 so workaround was to manually release app using Xcode 13.2 (which is already releasesd) and once Bitrise supports it, we’ll change it on Bitrise as well.