As of yesterday, an app I am developing is crashing on launch via TestFlight. It was working fine previously and the update was a very minor update (a couple of lines of business logic change). The issue seems to be related to the (new?) concurrency library, however the app doesn't use any of the new concurrency features. The app runs fine in the simulator and on a device when launched directly from Xcode.
When installed via TestFlight, the app crashes immediately on launch. The logs of the crash contain:
Library not loaded: @rpath/libswift_Concurrency.dylibuote
The workaround is to add libswift_Concurrency.tbd in the "Link Binary with Libraries" build phase (and make it optional).
Using: Xcode 13.1
So - I guess the question is: Do I wait for 13.2? I guess Apple is aware?
Also posting here so others don't waste too much time trying to figure it out (our certificate expired 12 hours before this happened, so we wasted most of the time thinking it was a certificate/provisioning issue...)
We have the same thing and it started happening since Tuesday. We are now trying to publish using the xcode 13.2 Release Candidate which hopefully will include this. Will keep you posted.
So 2 workarounds worked. Using XCode 13.1 and disable bitcode or XCode 13.2 release candidate with bitcode enabled. We went for the last option but for 13.1 users this should be fixed in my opinion.
@doozMen How did you ever get it to work with the 13.2 RC?
For me the error just changes to DYLD, Symbol not found: chkstk_darwin .... This is on an iOS 12 device though.
@Houwert we have it partially working in Xcode 13.2 RC
Yesterday all builds being uploading to TestFlight via Xcode 13.0 or 13.1 resulted in immediate crashes when opening. No crashes were observed when running locally on device.
We migrated to Xcode 13.2 RC and apps work on iOS 15, but apps running on iOS 14 devices still crash
We're going to try disabling bitcode and using Xcode 13.1 next
In our case, our app (deployment target of iOS 12) was hit with this issue when uploading a Bitcode enabled build that was compiled with Xcode 13.1.
Since we support iOS 12, we don't even use Swift Concurrency features so the issue came as a surprise to me. I tracked the problem back to the fact that one of our dependencies (RealmSwift) has some async code which while it wasn't used, it was enough for Apple to break our build when they processed it :D
To fix the issue for our upcoming release, I've forked RealmSwift to make sure that the code that depends on Swift Concurrency isn't compiled using the following patch:
Hopefully by the time our next release comes, Apple will have either fixed the issue or we can migrate to Xcode 13.2 instead but this might be a useful workaround if you want to get a build out asap without making any bigger changes.
what cause the issue is async / await , so if you do not use it, you may search your libraries and find out witch library is using it, in my case realm was using it and that cause the crash, so I downgrade the realm to the latest version that do not use async / await which is 10.14.0 then archive the app from Xcode 13.2 then it worked fine in devices above iOS 13
Disabling bitcode should work. Alternatively, you can add this to Other Linker Flags: -Wl,-weak-lswift_Concurrency -Wl,-rpath,/usr/lib/swift.
This surprises me, because anything built with Xcode 13.2 RC with a deployment target prior to iOS 15 should have the back-deployed concurrency library (libswift_Concurrency.dylib) embedded in the app bundle. Is it not there? Are you able to attach the app bundle to a feedback for us to inspect?
On iOS12 loading fails because the bundled libswift_Concurrency.dylib is built for iOS13.0.
So weak linking doesn't help.
Termination Description: DYLD, Symbol not found: ___chkstk_darwin | Referenced from: /private/var/containers/Bundle/Application/F448A9D5-5B6C-438D-B2B4-656C88BCE1D9/XYZ.app/Frameworks/libswift_Concurrency.dylib (which was built for iOS 13.0) | Expected in: dyld shared cache | in /private/var/containers/Bundle/Application/F448A9D5-5B6C-438D-B2B4-656C88BCE1D9/XYZ.app/Frameworks/libswift_Concurrency.dylib
We don't use the async/await parts of RealmSwift so I guess the ideal would be that libswift_Concurrency.dylib is removed from the app on iOS12...
@alexliubj: REALM_INCLUDE_CONCURRENCY is not defined, and that's how we are sure that the #if compile condition evaluates as false (and therefore doesn't include the async code)... I just thought that it was cleaner to do this than commenting out the code
I received a mail from apple on the bug report FB9802787 (App distributed via TestFlight crashes on launch due to Library not loaded: @rpath/libswift_Concurrency.dylib when bitcode enabled) that it has been fixed as of 13.2.1
yo yo, this thread was so helpful so thank you to everyone who contributed. we were losing our minds on this but for us, found the fix was actually stripping bitcode out of both the core target project but also pods too if you use pods
just thought I'd drop in case helpful to anyone else
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
I have the same problem. my app crashes in app store after releasing an update from xcode14.1.. crashes happens often in application didFinishLaunching options, sometimes in firebase configure method, sometimes in other places.. We are clueless with this issue, trying trial and error with bitcode and etc. can someone please direct me on the correct solution