4

All the while, we are using Google Play Console to capture crash report.

We need to upload Proguard/R8 mapping file manually, in order to deobfuscate the crash stack trace.

enter image description here

According to https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?authuser=0&platform=android and https://stackoverflow.com/a/47292432/72437 , such operation is no longer required.

May I know, what happen behind the scene? When does Firebase Crashlytics upload Proguard/R8 mapping file to their server?

Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875

2 Answers2

5

The upload happens automatically when you run a build. In the build output you will see a line similar to this:

:app:crashlyticsUploadDistributionDevelopDebug

That's the task that uploads the mappings. This is all managed by the crashlytics gradle plugin that you added to your build.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • 4
    But what happens if you build the app multiple times, with same version name and version code, but based off of a different codebase? – arekolek Jun 19 '20 at 13:53
  • 2
    @arekolek it will generate and send a new mapping file each time. every build, a new mapping file ID is generated and injected into the built APK by Crashlytics. you will find this inside your built APK in strings.xml and it will have key name of either `com.crashlytics.android.build_id` or `com.google.firebase.crashlytics.mapping_file_id`. this uniquely identifies that build, you can even try running the build multiple times and you'll see it changes every time. it's used to associate a crash with the corresponding mapping file – Adam Burley Jun 17 '21 at 18:40
0

You can use this path to upload your mapping file manually.

Use HTTP PUT to upload the mapping.txt file to the URL below.

I did check and it worked:

crashlyticsMappingUrl =
"https://firebasecrashlyticssymbols.googleapis.com" +
"/v1/project/-/app/$googleAppId/upload/java/$crashlyticsBuildId" +
"?X-CRASHLYTICS-API-CLIENT-TYPE=crashlytics-gradle&X-CRASHLYTICS-API-CLIENT-VERSION=$firebase_crashlytics_gradle"
  • $googleAppId: your Google App Id
  • $crashlyticsBuildId: set it to "00000000000000000000000000000000"
    (default build-id
  • $firebase_crashlytics_gradle: apply the version here. For me, I am using "2.9.1"