The customer is using the MobileIron MDM tool for app deployment and using mobileiron wrapper tool for enabling apptunnel for our app (VPN less app) when we upload the iOS 13 app to MDM the app crashes. After logged a support call with Mobileiron and the root cause for the crash was identified that APSanalytics library trying to send the synchronous request on the main thread which is against Apple's recommendation
Attached the response from MobileIron support below. Currently, we have disabled the Analytics module (in tiapp.xml) in our app and the app is not crashing. But we are losing the Appcelerator analytics data.
can you please take a look at the issue and fix it the SDK.
Mobileiron Support engineer response
We have identified why your wrapped app is crashing. The app uses Appcelerator's APSAnalytics library to send requests on app launch before AppConnect is initialized. By design, AppConnect blocks any network requests until any AppTunnel Rules are received. However, APSAnalytics makes a synchronous request on the main thread, which is against Apple's recommendations.
default 12:54:03.431961 +0200 mPeople [ERROR] APSAnalytics: error sending request: The operation couldn’t be completed. Request timed out earlier than tunneling config was received.
default 12:54:03.434021 +0200 mPeople [INFO] APSAnalyticsStore: session.start
default 12:54:03.439620 +0200 mPeople [INFO] APSAnalyticsStore: mPeople_iphone_12.4.1_Home
debug process_assertion 12:54:03.444635 +0200 mPeople Request for backgroundTimeRemaining from pid -1
default 12:54:03.444799 +0200 mPeople [DEBUG] APSAnalytics: Attempting to send 2 analytics event(s)
Why the issue happened in 4.4.1: AppConnect 4.0 introduced networking changes for requests being processed without any AppConnect configuration. Now, we pause these until the config has been received. This was done to improve security of data-in-transit. This works for requests off the main thread, but for synchronous requests blocking the main thread, those are deadlocked.
Note that even in the unwrapped app, we can force an identical crash by setting "Network Link Conditioner" to "100% Loss", then launched the unwrapped application, minimized it, and open it again. Then, with "Network Link Conditioner" set to "Very Bad Network" the app also freezes, but for less than 10 seconds, so iOS doesn't kill it.
Conclusion: This looks like an Appcelerator bug. Perhaps they have a newer version available, or perhaps you can init APSAnalytics later in the app launch sequence, or not use it at all.