How to upload a mapping file to Firebase Crashlytics?

FirebaseCrashlyticsFirebase Crash-Reporting

Firebase Problem Overview


In the old Crash reporting - there is easy way to upload. i didn't find it in the Crashlytics section

Firebase Solutions


Solution 1 - Firebase

UPDATE: Firebase update their docs: see here

There is no need anymore to manually upload mapping file.

1 - To preserve the info Crashlytics needs for readable crash reports, add the following lines to your config file:

-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception

2 - To let Crashlytics automatically upload the ProGuard or DexGuard mapping file, remove this line from the config file (app/proguard-rules.pro):

-printmapping mapping.txt

> For faster builds with ProGuard, exclude Crashlytics. Add the > following lines to your config file:

-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**

Solution 2 - Firebase

Mike from Firebase here. Crashlytics in Firebase does not offer a way to upload mapping files outside of the build flow. I'm personally curious, did you use the manual upload frequently?

Solution 3 - Firebase

If you have followed the indications to enable the automatic upload then build the app and you still see the stack traces obfuscated in Firebase you should check the log files:

> On Linux / Windows: > /.crashlytics/com.crashlytics.tools/crashlytics.log
> On Mac: > ~/Library/Caches/com.crashlytics/com.crashlytics.tools/crashlytics.log

Look for the latest entry with: Uploading deobfuscation file

And try to find the result of the operation like: Deobfuscation file(s) uploaded or Crashlytics had a problem uploading the deobs file and you will get some hints about the cause.

Solution 4 - Firebase

Set the firebaseCrashlytics.enableMappingFileUpload Gradle extension property to true in your app-level build.gradle file.

// To enable Crashlytics mapping file upload for specific product flavors:
  flavorDimensions "environment"
  productFlavors {
    staging {
      dimension "environment"
      ...
      firebaseCrashlytics {
        mappingFileUploadEnabled false
      }
    }
    prod {
      dimension "environment"
      ...
      firebaseCrashlytics {
        mappingFileUploadEnabled true
      }
    }
  }

for more details visit Click here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionitzharView Question on Stackoverflow
Solution 1 - FirebaseitzharView Answer on Stackoverflow
Solution 2 - FirebaseMike BonnellView Answer on Stackoverflow
Solution 3 - FirebaseJuan FrancoView Answer on Stackoverflow
Solution 4 - FirebaseMansukh AhirView Answer on Stackoverflow