Flutter android how to get readable firebase crashlytics report?

677 views Asked by At

We have obfuscated our code on the Android side, and since then, we can't get a readable crashlytics report. I tried so many options, but nothing has worked so far.

enter image description here

I tried many different solutions.

First: I enabled/disabled mappingFileUploadEnabled & uploaded with and without debugging_file.zip to google play store using .aab file.

I created debugging_file.zip using three files under build/app/intermediates/flutter/prodRelease/ which are arm64-v8a, armeabi-v7a and x86_64.

Second: I enabled mappingFileUploadEnabled file & uploaded with and without debugging_file.zip to google play store using .aab file.

I created debugging_file.zip using three files under build/app/intermediates/merged_native_libs/prodRelease/out/lib which are arm64-v8a, armeabi-v7a and x86_64.

I am using :

flutter: 2.10.0
dart: 2.16.0
firebase_core: ^1.4.0
firebase_crashlytics: ^2.4.5
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
classpath 'com.android.tools.build:gradle:7.0.4'
kotlin_version = '1.6.0'

proguard:

-keep class androidx.lifecycle.** { *; }

-keepclassmembers class * extends java.lang.Enum {
    <fields>;
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable        # Keep file names and line numbers.
-keep public class * extends java.lang.Exception  # Optional: Keep custom exceptions.

gradle.properties:

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

Have any idea to encounter the problem?

1

There are 1 answers

0
Ahmed Nabil On

after many researchers and multiple tries to get a solution for this problem this is as far as i have gone. you can only deobfuscate dart code manually using this command

flutter symbolize -i <stack trace file> -d /out/android/app.android-arm64.symbols

check this link for more info https://docs.flutter.dev/deployment/obfuscate

the steps i followed to solve it is as follows: 1-create file error.txt 2-copy paste stacktrace from crashlytics where numbers are inlined.

ex :

  #08 abs 0 virt 00000000002ccc63 _kDartIsolateSnapshotInstructions+0x114473 (.java)
  #09 abs 0 virt 00000000002ccae3 _kDartIsolateSnapshotInstructions+0x1142f3 (.java)
  #10 abs 0 virt 000000000059d687 _kDartIsolateSnapshotInstructions+0x3e4e97 (.java) 

3-add before every line 2 to 4 spaces. 4-remove (.java) if exist.

5-run this command in flutter terminal

flutter symbolize -i error.txt -d build/app/outputs/symbols/app.android-arm64.symbols