With this change in the Google console for developers, I'm a bit lost, when I went to review my application to upload it, I got the following:
Warning This APK contains Java or Kotlin code, which can be obfuscated. We recommend that you upload a deobfuscation file to facilitate analysis and debugging of ANR errors and crashes. More information
I have been looking for information on obfuscation and have read about proguard. I have activated it but when I go to Firebase, the names of the fields in my database have been shortened and they do not come out with their real name. I have read that for this I must upload the deobfuscation file together with the bundle that I upload to the store, but I cannot find the option to upload said file anywhere.
The message is just a warning which suggests you to obfuscate your code so that it is not visible by reverse engineering the source code. Being a warning you will be able to upload your application without problem.
This is done with the following configuration, mainly the property
minifyEnabled true
:Check out: How to shrink, obfuscate, and optimize your app
You must create your file to obfuscate code and to upload it, you do it from the Google Play console , select the application and from "Releases overview", you can review the latest releases or search by version, and click on the blue arrow:
Inside the "App bundles and APKs" section, click on the 3-dot symbol to access the "Upload ReTrace mapping file (.txt or .map)" option, this is where you will upload your file.
You shouldn't need to upload any files. You just have to activate the minification:
Traditionally this enabled proguard but as of version 3.4.0 of the Android Gradle plugin it was replaced by R8. This is the new code shrinker developed by google and optimized for android. It has two main tasks:
Although R8 is a new compiler, it uses the same settings as proguard. These settings are found in files defined in gradle as proguardFiles:
However, there are easier ways to do it. For example you can use the annotation
@Keep
so that R8 does not modify a class.Another alternative is to use
@PropertyName
firebase annotation.This way you won't have any problems when names are shortened as firebase will use the annotation string instead of the property name.