Description
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2021.3.21f1
- Firebase Unity SDK version: 11.4.0
- Source you installed the SDK: .unitypackage
- Problematic Firebase Component: Crashlytics
- Other Firebase Components in use: Analytics
- Additional SDKs you are using: None
- Platform you are using the Unity editor on: Windows
- Platform you are targeting: iOS, Android
- Scripting Runtime: il2cpp
- Pre-built SDK from the website
[REQUIRED] Please describe the issue here:
I would like to re-open issue #563. We appear to be encountering the issue described there, which appears to have been closed without any resolution. As described in that ticket:
Crashlytics increases the time a Unity app freezes when handling an uncaught exception by several orders of magnitude.
I could retype and redescribe everything in that ticket but it feels a bit wasteful to do so.
I cloned the repo mentioned in the original ticket and updated Firebase to v11.4.0. I also modified the scene and added a button that does a try/catch to see how handled exceptions that still log the error behaves. The only additional information I can add is that even the TryCatch causes the freeze even though I am not explicitly logging it to Crashlytics. It does, however, only behave this way when Crashlytics is initialized which would seem to indicate that Crashlytics is still the problem.
Steps to reproduce:
The steps described in the original ticket still apply:
- Open the crashlytics-issue-repro project in Unity 2021.3.21f1
- Import your own
google-services.json
- Ensure scripting backend is set to IL2CPP
- Build and run on any Android phone. The issue is much more visible on slightly older phones.
- After the app starts, press the "Freeze for 3 Seconds" button as a calibration test. This simply invokes
Thread.Sleep(3000)
, so the resulting text should show a freeze of around 3 seconds. - Press the three "Throw" buttons in sequence. "Throw (Simple Stack)" and "Throw (Many Threads)" should be very fast, while "Throw (Async Stack)" could lead to a short freeze.
- Press the "Initialize Firebase" button. Crashlytics is now running.
- Press the three "Throw" buttons in sequence. "Throw (Simple Stack)" and "Throw (Many Threads)" should now take several seconds (depending on device), while "Throw (Async Stack)" and "Throw (Async Stack TryCatch)" should lead to a very long freeze (almost 30 minutes on the Huawei device).
Downloadable Repro Project: https://github.com/FodderMK/crashlytics-issue-repro