[TIMOB-27583] iOS: Crash with MobileIron wrapped app
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-11-21T23:47:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 8.3.0 |
Components | n/a |
Labels | engSchedule |
Reporter | Shuo Liang |
Assignee | Gary Mathews |
Created | 2019-11-14T02:03:04.000+0000 |
Updated | 2019-11-21T23:47:21.000+0000 |
Description
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.
{quote}
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.
{quote}
aps_sdk: https://github.com/appcelerator/aps_sdk/pull/339 master: https://github.com/appcelerator/titanium_mobile/pull/11345 8_3_X: https://github.com/appcelerator/titanium_mobile/pull/11356
FR Passed. PR's merged.
Verified the fix with SDK 8.3.0.v20191120160657 & 9.0.0.v20191121074219. Closing.