Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unity 2019.3 crashes on iOS 13+

Discussion in 'iOS and tvOS' started by GI167789, Apr 30, 2020.

  1. GI167789

    GI167789

    Joined:
    Nov 24, 2015
    Posts:
    1
    First, I already filed an issue to bug tracker (#1239867). I'm purely writing this to make some of the points clear to users who will encounter this bug, because it sometimes happens with a quite strange stack trace, and it's impossible to find the correct info about it on the internet. There's a discussion here https://github.com/firebase/quickstart-unity/issues/610 but I believe it would be more appropriate if google search will lead here instead.

    Ok, so Unity player crashes when application is closing IF some other view is shown, not the unity one. Like ads or some other screen, Game Center probably will crash too. The crash happens in background, so it is not visible to users except for testflight builds. But it spams a lot in Crashlytics and Appstore Connect bringing crash-free user count to less than 90%. Depends on how often you show ads and how often users rage quit from them.

    WTR is simple: launch the game, start the ad, close the game while ad is running. Stack trace is
    The trick is the stacktrace is shown incorrectly in Crashlytics because it doesn't support Unity 2019.3 multiple dsym files yet. So this crash would show up as some UnityFramework MetalHeap::AliasResources() + 89728. Or something like
    UnityFramework UnityAdsEngineSetDidFinishCallback + 30760. The problem is if you google that, all you can find is some misleading info if any. But this is still the same crash. The only thing that I found is github thread above.

    As @arkenthera suggested here https://github.com/firebase/quickstart-unity/issues/610#issuecomment-616839366 the crash goes away if one manually changes applicationWillTerminate to 2019.2 version.
    Crash free stats looks meh
    upload_2020-4-30_17-3-36.png

    Stack trace is meh (but this is crashlytics problem)
    upload_2020-4-30_17-12-5.png

    Appstore connect won't provide any stack trace at all (there's no *.crash file around)
    upload_2020-4-30_17-8-14.png

    Hopefully this bug will be addressed as soon as possible: it is very annoying, reproduces 100% of the time and steps to reproduce are pretty simple. In the meantime, can someone from Unity team clarify if the provided workaround is safe to use?
     
  2. odysoftware

    odysoftware

    Joined:
    Jul 21, 2015
    Posts:
    84
    I can confirm several native crashes with unity version 2019.3.9f1, 2019.311.f1... on closing the ios app! It doesn't seem to be only related to Ads (since my app does not use ads).

    When going back to 2019.3.6f1 everything is fine again.
     
    yurykorzun likes this.
  3. Tortuap

    Tortuap

    Joined:
    Dec 4, 2013
    Posts:
    126
    Do you have any update on this ?
    I have a very similar crashes reported by Crashlytics, but I can't reproduce it on iPhone XR or iPhone 6S Plus.
     
    Last edited: May 9, 2020
  4. kgbv

    kgbv

    Joined:
    Jun 5, 2013
    Posts:
    13
    i faced the same issue in Unity 2018.4.21f1
    plugins used : Admod, FB audience network etc .

    what i tried :

    Previously :

    • (void)applicationWillTerminate:(UIApplication*)application
      {
      ::printf("-> applicationWillTerminate()\n");

      Profiler_UninitProfiler();

      if (_unityAppReady)
      {
      UnityCleanup();

      }
    extern void SensorsCleanup();
    SensorsCleanup();
    }

    changed to :

    • (void)applicationWillTerminate:(UIApplication*)application
      {
      ::printf("-> applicationWillTerminate()\n");

      Profiler_UninitProfiler();

      extern void SensorsCleanup();

      if (_unityAppReady)
      {
      UnityCleanup();
      SensorsCleanup();
      }
    }

    its working fine now without any crash while close and reopen while i build it directly to my iPad
    but after uploading to test flight i am facing the same issue.
     
    Last edited: May 11, 2020
  5. Tortuap

    Tortuap

    Joined:
    Dec 4, 2013
    Posts:
    126
    "but after uploading to test flight i am facing the same issue."
    So it's not solved on your side right ?

    Why writing "how I resolved", "its working fine now" to finally conclude "but after [...] I am facing the same issue" ?
     
    sasimsimity likes this.
  6. kgbv

    kgbv

    Joined:
    Jun 5, 2013
    Posts:
    13
    i have updated the answer
     
  7. kgbv

    kgbv

    Joined:
    Jun 5, 2013
    Posts:
    13
    Actually its working fine in direct device build and but uploading test flight and test the same build i face this issue.
     
  8. Tortuap

    Tortuap

    Joined:
    Dec 4, 2013
    Posts:
    126
    Solution's here : I solved it on my side, following what user soranigic indicated to do here : https://github.com/firebase/quickstart-unity/issues/610#issuecomment-618897361.

    My new build is live since 2 days, I acquired 2000 new users on it, and so far, not a single crash for that fixed version while the previous version has 5% of users crashing at close ( more than 50 per day ).

    I'm using Unity 2019.3.11f1.

    If the Unity team read this message, here is a strong hint on what to investigate regarding this issue.
     
    Last edited: May 12, 2020
  9. kgbv

    kgbv

    Joined:
    Jun 5, 2013
    Posts:
    13
    Still i am facing the same issue .
     
  10. Tortuap

    Tortuap

    Joined:
    Dec 4, 2013
    Posts:
    126
    I'm not replying that for you, but for other people that have the same issue.
    Have you tried the fix I mentioned here ?

    If you did, but still have a crash, then your issue is probably not the one mentioned here.
     
  11. seven_

    seven_

    Joined:
    Sep 30, 2014
    Posts:
    42
    I have not tried the fix, but I can report that the issue still occurs in 2020.4.1. If anyone is able to post a link to the original issue (supposedly #1239867), please do so -- I cannot find it in Unity's issue tracker. I can find a duplicate issue (https://issuetracker.unity3d.com/is...controller-up-causes-the-application-to-crash), being marked as duplicate by Unity, without referring to the original issue...
     
  12. Flexford

    Flexford

    Joined:
    Dec 8, 2016
    Posts:
    20
  13. MildaGenius2

    MildaGenius2

    Joined:
    May 6, 2013
    Posts:
    19
    Mayby this can be original?
    https://issuetracker.unity3d.com/is...ns-triggers-watchdog-termination-after-launch
     
  14. Tortuap

    Tortuap

    Joined:
    Dec 4, 2013
    Posts:
    126
    Not even close.
    Please read description of problems before pointing out different issues that are not at all related to.
    The issue talked in this thread is about crash when application closes. The callstack is clear.
    The issue you linked is about crash at launch, with a totally different callstack, symptoms, and solution.
     
  15. safu

    safu

    Joined:
    Mar 23, 2019
    Posts:
    3