quickstart-unity
quickstart-unity copied to clipboard
[Bug] ANR traces are not symbolicated
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2020.3.32f1
- Firebase Unity SDK version: 8.8.0
- Source you installed the SDK: .unitypackage
- Problematic Firebase Component: Crashlytics
- Other Firebase Components in use: Analytics
- Additional SDKs you are using: Facebook, Singular, AppLovin MAX SDK, AdMob, ironSource, AdColony,
- Platform you are using the Unity editor on: Windows 11 Pro
- Platform you are targeting: Android
- Scripting Runtime: IL2CPP
[REQUIRED] Please describe the issue here:
I can see my ANR in the Crashlytics but it is not symbolicated:
As a text:
Steps to reproduce:
It is 100% reproducible.
- I am building the game locally;
- Then I upload symbols using Firebase CLI and it works as expected:
Crashlytics symbol file uploaded successfully;
- Then I run the game and generate an ANR making an infinite loop in the
main
thread. - I see my ANR report in the Firebase Crashlytics but it is not symbolicated.
The interesting part:
I used Unity's Stacktrace Utility (comes with Android Logcat package) to symbolicate this stack trace using the same symbols I uploaded earlier to Crashlytics and it works as expected:
Under the hood this utility uses addr2line so I guess this proves that this trace definitely can be symbolicated!
Hi @AntonPetrov83,
Thanks for reporting this issue. Version 9.0.0 of the SDK has been released recently. Could you verify if this version makes any difference? Otherwise, please provide a minimal, reproducible example of your implementation along with the complete steps to reproduce the issue so that we can identify what's causing this behavior.
Hi @paulinon,
I have upgraded Firebase Crashlytics to 9.0.0, I have upgraded Firebase CLI to 11.0.0, I have successfully uploaded symbols and triggered an ANR - still nothing :(
UPDATE:
So, it is 100% reproducible.
- Take the test app
quickstart-unity/crashlytics/testapp
and open it with Unity 2020.3.32f1 (LTS); - Follow general setup instructions to enable Crashlytics in Firebase Console;
- Modify
UIHandler.cs
to add new "Trigger ANR" button like this:
public void TriggerAnr() {
DebugLog("Triggering an ANR. Wait for system popup and Close the App");
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
activity.Call("runOnUiThread", new AndroidJavaRunnable(InfiniteLoopOnMainThread));
}
void InfiniteLoopOnMainThread() {
while (true) ;
}
void GUIDisplayControls() {
...
if (GUILayout.Button("Trigger ANR")) {
TriggerAnr();
}
...
}
- Build Android build with "Create symbols.zip" enabled;
- Upload symbols using Firebase CLI;
- Run the app, trigger an ANR, wait for ANR dialog and close the app;
- Run again to send crashlytics;
- See the bug:
Thanks for the additional information, @AntonPetrov83. I've replicated the issue using the steps you provided, and I'll relay this to the team. I also noticed that the ANR isn't reported when it's coming from a device with a lower Android version (in my case, Android 9).
I'll be marking this as a bug for now, but you may refer to this thread for updates.
Hey @AntonPetrov83, right now Crashlytics isn't able to symbolicate ANRs, but we are working on it. I don't have a TBD yet but will update here when we get it released.
@paulinon There was an announcement at the Games Developer Summit that symbolication of native Android ANRs is now supported. Wouldn't it solve this issue ? What version of Crashlytics has this support?