androidfirebaseandroid-gradle-plugincrashlyticsandroid-r8

Obfuscated stack traces in Firebase Crashlytics


Anyone here who has had problems with Firebase Crashlytics and R8 obfuscation? I keep getting obfuscated stacktraces in the console. It seems like the mapping.txt file is correctly uploaded to the Crashlytics API when building the app:

2023-09-08T10:46:40.132+0200 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request PUT /v1/project/-/app/[redacted]/upload/java/[redacted] HTTP/1.1
2023-09-08T10:46:40.132+0200 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: UNCHALLENGED
2023-09-08T10:46:40.132+0200 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED
2023-09-08T10:46:41.794+0200 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection can be kept alive indefinitely
2023-09-08T10:46:41.795+0200 [DEBUG] [com.google.firebase.crashlytics] PUT response: [reqId=null] 200
2023-09-08T10:46:41.796+0200 [INFO] [com.google.firebase.crashlytics] Mapping file uploaded: [redacted]/build/outputs/mapping/qa/mapping.txt
2023-09-08T10:46:41.796+0200 [LIFECYCLE] [org.gradle.internal.operations.DefaultBuildOperationRunner] 
2023-09-08T10:46:41.796+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileQa'
2023-09-08T10:46:41.797+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Executing task ':app:uploadCrashlyticsMappingFileQa''
2023-09-08T10:46:41.738+0200 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 
2023-09-08T10:46:41.738+0200 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :app:uploadCrashlyticsMappingFileQa
2023-09-08T10:46:41.796+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileQa' completed
2023-09-08T10:46:41.797+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Executing task ':app:uploadCrashlyticsMappingFileQa'' completed

Also when using R8 Retrace locally with the mapping file and the stacktrace as downloaded from the Firebase Console it de-obfuscates without problems:

// this works fine and outputs the de-obfuscated stracktrace
./retrace [redacted]/app/build/outputs/mapping/qa/mapping.txt [redacted]/stack.txt

Any idea’s? It seems like Firebase doesn’t have the option to upload mapping files manually or view uploaded mapping files in the console anymore.


Solution

  • Yes, I have had these problems with Firebase Crashlytics but in android studio electric eel 2022.1.1 the only solution I gave was to update my buil.grable module to a previous version and it worked for me, it doesn't help much but I hope it works for you.

           // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
        repositories {
            google()
            jcenter()
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:7.2.2'
            classpath 'com.google.gms:google-services:4.3.15'
            // firebase-crashlytics
            classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
            classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.0"
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    plugins {
        id 'com.android.application' version '7.4.2' apply false
        id 'com.android.library' version '7.4.2' apply false
    }
    allprojects {
        repositories {
        }
    }
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    // main module

    dependencies {
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.9.0'
    implementation 'com.google.firebase:firebase-config'
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics:21.2.2'
    implementation 'com.google.firebase:firebase-core:21.1.1'
    //Firebase database