Automatically upload ProGuard mapping files to play console

Viewed 2464

Is pretty annoying to upload the ProGuard mapping files to google play console everytime i need to build a new version of my apk (my gradle build generate 4 different apks for every release so i do need to upload 4 different mapping files)

I was wondering if is possible to make this process automatically then i found this article

https://developers.google.com/android-publisher/api-ref/edits/deobfuscationfiles/upload

So google does have an api to upload the mapping files, is there any gradle plugin to work with? is there any easy way to integrate?

3 Answers

Suggestion: If you publish an Android App Bundle instead of APKs, the deobfuscation mapping file will be uploaded automatically with your artifact so you don't have to do it separately.

For the curious, the mapping file is located at BUNDLE-METADATA/com.android.tools.build.obfuscation/proguard.map in AAB (which is, like the APK format, just a ZIP file).

when you have Crashlytics set up, this is being explained here. there's also a Play Publisher Plugin for Gradle, while it does no seem to upload the mapping.txt. if you want to use that API, it should be easy to extend eg. the Google Cloud PHP Client with another API endpoint.

Related