I have an Android project using two firebase instances per build variant (e.g. staging -> Firebase Project 1 and release -> Firebase Project 2). I'd like to be able to upload the mapping.txt whenever I invoke assemble so the crashes would be deobfuscated. Is there a way to dynamically set FirebaseServiceAccountFilePath property for each build variant? Thanks
Define FirebaseServiceAccountFilePath dynamically for build variants
502 Views Asked by Emarc Magtanong At
2
There are 2 best solutions below
0

I faced this problem too today. After spending some time on this I simply wrote .sh file copied both the ./gradlew statements. It is simply running both the statements one by one and I am able build apk and upload mapping file programmatically for both the firebase projects in single invocation.
Currently, you will have to invoke two different builds on the command line with the two different paths for your service account. So, something like this, if you have variants foo and bar:
There isn't currently a way to specify a different service account for both builds in a single invocation. However, if both variants use the same mapping, you can upload them both in the same invocation.