Search Issue Tracker

Won't Fix

Votes

1

Found in

2019.2.21f1

2019.3.0b11

2020.2

Issue ID

1220389

Regression

Yes

[UaaL][iOS] Crash on bundle load when re-opening deployed app

Mobile

-

Reproduction steps:
1. Download and open the attached "BugReproProject" project
2. Switch to iOS platform
3. Build and deploy the project
(The following steps are made on the device)
4. Close the deployed app
5. Open the deployed app

Expected result: The app does not close itself after a few seconds
Actual result: The app closes after a few seconds

Reproduces on: 2019.3.0b11, 2019.3.16f1, 2019.4.11f1, 2020.1.6f1, 2020.2.0b4
Does not reproduce on: 2018.4, 2019.2
Could not test with: 2019.3.0a1, 2019.3.0b10 (Unity hangs while importing assets)

Tested with: iPhone 6S (iOS 13.3.1)

  1. Resolution Note (2020.2.X):

    App is killed by watchdog because there is a deadlock on the synchronization code path going through UIApplicationConfigurationLoader.
    When UnityFramework is loaded with [NSBundle load] dyld loads other dependent libraries and initialize global variables at this moment SpeechToTextViewController plugin is constructed in global space and it deals with UI system, specifically [super init]; from -(id)init method to UIViewController leads to deadlock.

    Bottom line plugin initialization point should be fixed, it is best to be initialized after unity is initialized so do not relay on +load or global variable constructors in native code or attribute constructor

    Possible workarounds:
    - link UnityFramework to the main target, this removes dynamic loading step and makes all to be linked to the main executable earlier what makes initialization order in favor of a plugin
    - in the main target deal with UI system before loading UnityFramework library this "warmups" process state and hides deadlock issue

    Note: This deadlock issue appears in an empty Xcode template project ( load framework (with global variable constructor of class derived from UIViewController and call super init) in main method of main target )

Comments (1)

  1. lukem123

    Sep 30, 2020 14:21

    Due to this bug I've been stuck on 2019.2 for over 6 months since I can not build for iOS at all on any new versions, and it's a mobile app for Android and iOS so that's a huge deal breaker. Are others not experiencing this issue? It feels super high priority to me if it breaks an entire platform - any idea when this will be fixed?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.