Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploading ProGuard Mapping Files to Firebase

Am trying out the recently released feature that allows uploading of ProGuard mapping file to Firebase (https://firebase.google.com/docs/crash/android) using gradle task. The following is the task I'm running.

./gradlew -PFirebaseServiceAccountFilePath=xxxxx.json :app:firebaseUploadReleaseProguardMapping

However, it doesn't seem to be recognizing service account file. Has anyone had any luck getting this working? I've also tried defining FirebaseServiceAccountFilePath in gradle.properties.

* What went wrong:
Execution failed for task ':app:firebaseUploadReleaseProguardMapping'.
> Service account file path has not been defined! Service accounts are used to authorize your mapping file uploads.  Learn more at
  https://firebase.google.com/docs/crash/android.
like image 586
John O'Reilly Avatar asked Dec 17 '16 12:12

John O'Reilly


2 Answers

Set relative path to json in gradle.properties (in project root)

FirebaseServiceAccountFilePath = /firebase-crashreporting.json

and update this property in your build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-crash'

android {
    ...
}

setProperty("FirebaseServiceAccountFilePath", rootProject.rootDir.absolutePath + FirebaseServiceAccountFilePath)

dependencies {
    ...
}
like image 79
OlegKrikun Avatar answered Nov 08 '22 13:11

OlegKrikun


The error message is misleading. You will see that if the file path that you give for the service account wasn't found. Try passing the full, unambiguous path of the service account file (try not to depend on relative paths).

I'll make sure that the next version of the plugin has a more meaningful error message for the case where the file isn't found. Sorry about the trouble.

like image 44
Doug Stevenson Avatar answered Nov 08 '22 14:11

Doug Stevenson