Search Issue Tracker

Won't Fix

Votes

96

Found in

2019.3.15f1

2019.4

2020.2

Issue ID

1262272

Regression

No

[iOS][UaaL] UnityFramework with 3rd party plugins triggers watchdog termination after launch

iOS

-

Reproduction steps:
1. Open project in "FirebaseTestMintegral.zip"
2. Build the project for iOS
3. Open .xcworkspace generated in the build folder
4. Deploy the Application to an iOS device
5. Shut the Application down (using Xcode or the device itself)
6. Open the Application from the device (without using Xcode)

Expected result: the Application will launch successfully
Actual result: the Application starts launching and shuts down in around 10-20 secs

Reproducible with: 2019.3.15f1, 2019.4.5f1, 2020.1.0f1, 2020.2.0a18
Could not test with 2018.4, 2019.3.0a1 because I was unable to resolve package/namespace errors

Devices tested:
Reproducible with:
VLNQA00310 iPad Pro 12.9 1st gen (iOS 13.4.1)
Not reproducible with:
VLNQA00204 iPhone 5C (iOS 10.3.3)
iPhone 7 iOS 12.3.
iPad 7th gen iOS 13.2.2
VLNQA00015, Samsung Galaxy Note8 (SM-N950W), Android 8.0.0, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540

---------------
Possible workaround:
By default UnityFramework.framework is embedded in Unity-iPhone target and it is not linked with it some plugins are sensitive to this initialization path. UnityFramework is loaded later at runtime.
* Go to Unity-iPhone / Build Phases / Link Binary with Libraries build section and add UnityFramework.framework.
UnityFramework will be loaded at the same time as the main executable.

  1. Response avatar

    Resolution Note (2021.1.X):

    At some point, UnityFramework runtime together with plugins is loaded at run time by dyld/NSBundle.load. Please keep that in mind while developing a plugin.
    Any API-rich initialization on +(load), attribute(constructor), and global object construction code paths should be moved to a later phase preferably after UnityFramework is loaded, and even better when Unity is initialized.
    Simple plain data initialization is safe, but API-rich calls that deal with other os parts especially networking and user interface APIs might lead to deadlock leading to watchdog termination.
    By doing delayed/lazy initialization you can get better control over initialization order, you can reduce the application load time, and most importantly you avoid possible deadlock.

    ---------------
    Possible workaround:
    By default UnityFramework.framework is embedded in Unity-iPhone target and it is not linked with it, UnityFramework is loaded later at runtime and some plugins are sensitive to this initialization path.

    * Go to Unity-iPhone / Build Phases / Link Binary with Libraries build section and add UnityFramework.framework.
    UnityFramework will be loaded at the same time as the main executable.

Comments (32)

  1. 7fd0c474c2e8a071c13746c492beb541?d=mm

    hiryma

    Sep 26, 2020 05:29

    Reproduced on
    - 2018.4.26 / 2018.4.27 / 2019.4.10 on iPhoneX with OS 14.0 / 14.2
    - 2018.4.27 on iPhoneSE with iOS 13
    - plugins: Obi, AppLovin MAX, Firebase(crashlytics, remoteConfig), facebook, admob ...
    - same as following
    - https://stackoverflow.com/questions/61953252/unity-ios-app-crashes-for-unclear-reasons

  2. 4d831347431d4b1bce560b95f071f073?d=mm

    BIMG

    Sep 03, 2020 11:47

    Reproduced on Unity 2019.4.9f1 on iPad 9.7 with OS 13.3.

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.