Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difficulties setting up Gradle to send ProGuard mapping files to Firebase

I am trying to follow this documentation tutorial by Firebase to setup Android Studio to automatically send my ProGuard mappings file when building a release APK for my Android application.

However, I couldn't seem to understand steps 4 and 5 in the "Uploading ProGuard mapping files with Gradle" part, mainly because I didn't find any gradle.properties file in my project root or home path and because I wish to automate the execution of the app:firebaseUploadReleaseProguardMapping task in Android Studio, which I don't know how to do.

This is the contents of the gradle.properties file I've created in my project root directory:

FirebaseServiceAccountFilePath = /app/firebase-crash-reporting.json

The firebase-crash-reporting.json file is my Firebase crash reporting private key. My mappings file is generated in the /app/build/outputs/mapping/release/ directory, if that helps.

Please assist me in completing those 2 steps and automatizing the process in Android Studio.

like image 267
Achraf Almouloudi Avatar asked Jan 21 '17 01:01

Achraf Almouloudi


1 Answers

Just add

afterEvaluate {
    assembleRelease.doLast {
        firebaseUploadReleaseProguardMapping.execute()
    }
}

In the android section of build.gradle file.

This will automatically upload the ProGuard mappings file to Firebase as well as run/deploy the APK to the device using ADB.

like image 147
Vipul Asri Avatar answered Sep 22 '22 05:09

Vipul Asri