App Crashes Only On Testflight Build

I guess its a swift compiler issue. To verify first go to Edit Scheme then change the Build configuration to Release mode in Run tab and then install the build locally. You will get to know where exactly its crashing.


In my case this happened after starting to use Xcode 11. It was a UISearchDisplayController (deprecated since iOS 8) that seems to work on a device or simulator in debug mode, but not in the release build. Xcode 11.3 doesn't give any inline warning in the code. The crash was hard to find, because the search controller wasn't used any more, it was orphaned code.


I solved the issue by changing the swift compiler optimization from fastest to none. I'm not sure if this is an ideal long term solution, but the build no longer crashes.


It might be the Bitcode related issue. Check if your all third-party libraries support bitcode then and then only set bitcode to YES else set to NO.

Actually Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store.