fluttercrashlytics

How to automatically de-obfuscate stack trace in Crashlytics


I have built an Android app with obfuscation as follows:

flutter build appbundle --release --obfuscate --split-debug-info=./symbolmap 

Firebase and Crashlytics are set up and log events. I have also successfully executed the following command to de-obfuscate the logs:

firebase crashlytics:symbols:upload --app=1:82XXXXXXX:android:bdXXXXXXX ./symbolmap

Errors are successfully logged in firebase/crashlytics, but look as follows:

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value
BuildId: bf30dXXXXXXXXXXX
#00 abs 00000070ec2de8b7 virt 00000000002468b7 _kDartIsolateSnapshotInstructions+0x100337
#01 abs 00000070ec2de25b virt 000000000024625b _kDartIsolateSnapshotInstructions+0xffcdb
#02 abs 00000070ec2dd923 virt 0000000000245923 _kDartIsolateSnapshotInstructions+0xff3a3
#03 abs 00000070ec54f487 virt 00000000004b7487 _kDartIsolateSnapshotInstructions+0x370f07
#04 abs 00000070ec4ee25b virt 000000000045625b _kDartIsolateSnapshotInstructions+0x30fcdb
#05 abs 00000070ec4ed7cb virt 00000000004557cb _kDartIsolateSnapshotInstructions+0x30f24b
#06 abs 00000070ec49b713 virt 0000000000403713 _kDartIsolateSnapshotInstructions+0x2bd193
#07 abs 00000070ec49b65f virt 000000000040365f _kDartIsolateSnapshotInstructions+0x2bd0df
#08 abs 00000070ec1e4217 virt 000000000014c217 _kDartIsolateSnapshotInstructions+0x5c97
#09 abs 00000070ec54eeff virt 00000000004b6eff _kDartIsolateSnapshotInstructions+0x37097f
#10 abs 00000070ec1e4187 virt 000000000014c187 _kDartIsolateSnapshotInstructions+0x5c07

This results in me having the following questions:

  1. It seems that the details to the errors above are obfuscated. Is my assumption correct? I have no idea what I should expect for non-obfuscated logs. How do they look like?

  2. How can I see in the Crashlytics console whether the symbolmap is successfully uploaded and used to deobfuscate logs?

  3. What am I missing to see the deobfuscated logs directly in Crashlytics?


Solution

  • What I found out in the meantime:

    On 1: I can confirm that above is an obfuscated stack (this already might be helpful for some I suppose :).

    The de-obfuscated stack includes easily readable information, e.g., in which methods and submethods the Error was thrown.

    As a fallback, you can de-obfuscate such stacks manually by downloading the stack trace from Crashlytics and run the following command:

    flutter symbolize -d PATH/TO/SYMBOLMAP -i obfuscated.txt -o deobfuscated.txt
    

    This could look like the following

    flutter symbolize -d ./symbolmap/app.android-arm64.symbols -i obfuscated.txt -o deobfuscated.txt
    

    On 2 and 3: It seems that only future crash reports in Crashlytics will be de-obfuscated, when uploading a symbol map:

    You need to upload the debug symbols before reporting a crash from an obfuscated code build.
    

    https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=flutter