How to upload a mapping file to Firebase?
Sorry if I'm late, but instead of creating an exception, like some suggest, here is a cleaner official way Firebase docs suggest. This guide will teach you how to automatically push the release apk mapping to Firebase Crash Reporter from your Android Studio IDE.
Go to the Get deobfuscated crash reports section. I'll cover some maybe-hard to follow points in that guide.
- Add all gradle lines as suggested in the docs
- Download the Private Key file as suggested
- Copy this Private Key file to the root folder of your project
- In your
gradle.properties
file, add this lineFirebaseServiceAccountFilePath=../name-of-downloaded-file.json
- In terminal, at the root of your project, run this line
./gradlew :app:firebaseUploadReleaseProguardMapping
.
This will build the release apk and upload it's mappings to Firebase in one shot.
Just keep in mind that if you're using a version control or open sourcing your project, keep your Private Key file ignored or kept safe from other team members.
Note that, you can also assign a shortcut to run this arcane gradle command by clicking on Gradle tab on right-hand-side. Then (root) -> Tasks -> Other -> firebaseUploadReleaseProguardMapping (right-click on this). Then add your favourite shortcut :)
MANUALLY UPLOAD "mapping.txt" WITHOUT GRADLE TASK
- Mapping file is Application Based
Mapping files are Application Version Based
So you have to upload mapping.txt file to firebase console after each version release.
After first crash or error is reported for a given app version, you can manually upload mapping.txt file.
You can find the file to upload at a file path that is similar to the following, but specific to your app:
<project root>/<module name>/build/outputs/mapping/<build type>/<appname>-proguard-mapping.txt
Example:
app/build/outputs/mapping/debug/app-proguard-mapping.txt
At Firebase Console,
Go to,
Firebase Console > Select Your App > Select "Crash Reporting" From Left Menu > Navigate To "MAPPING FILES" Tab > Press "UPLOAD" Against Your App Version. > DONE
See screenshot,
READ HERE Official instruction for manual mapping file upload to firebase console