Android version release warning message: This App Bundle contains Java/Kotlin code, which might be obfuscated
Asked Answered
V

6

67

I got this warning message:

This App Bundle contains Java/Kotlin code, which might be obfuscated. We recommend you upload a deobfuscation file to make your crashes and ANRs easier to analyze and debug

what does it mean? what is the shortest solution for this?

Vaniavanilla answered 4/9, 2020 at 23:49 Comment(2)
your code could be obfuscated by proguard so any crash analysis systems could give unreadable logs and advises to create and upload a de-obfuscation file support.google.com/googleplay/android-developer/answer/…Parturition
But I do already get good crash reports with accurate function names and line numbers. Can I just ignore this message then?Vaso
G
78

Seems like it's a warning message coming from the new play console, you can solve it just by setting your minimum api level to 29 or even better by uploading the retrace mapping file as described here. Enable minify :

 buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    } 

After building apk/app bundle you can find /app/build/outputs/mapping/release/mapping.txt file . New console will allow you to upload mapping.txt along with your apk or bundle. You can find this option from App bundles and APKs menus.(According to this)

Gagman answered 5/9, 2020 at 0:32 Comment(7)
Goto the app in play console > App bundle explorer > On the top right click artifact and select the latest version that you just uploaded > Then go to downloads tab > Scroll down to assets tab > Upload it to "ReTrace mapping file" via the upload button on the right.Gagman
In my case (using Mac OS) mapping.txt located in build/app/outputs/mapping/r8/release/mapping.txtPollard
I use flutter build apkPollard
@SharifRafidUrRahman when i upload .aab and after i upload mapping.txt i have error/warning "You need to upload a valid .apk file.", i deleted mapping.txt and no have any warnings! Answer Rushabh work well) but i cant understand how(Sweet
@SharifRafidUrRahman should be included as the correct answer tyFimble
@Sweet clean build. Rebuild. Increase version number then generate signed apk/aab then upload again with newly generated mapping text.Gagman
Thanks. Mine work by only changing minifyEnabled to trueHellkite
A
22

Just changing minifyEnabled to true worked for me

Agar answered 7/9, 2020 at 22:3 Comment(1)
did you configure your proguard?Mccain
S
9

You can solve this by just enabling minify in your build. gradle(app) file:

buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    } 
Simpkins answered 31/12, 2020 at 6:10 Comment(0)
M
5

Just enable minify in your build.gradle(app) file:

 buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    } 
Maugham answered 20/10, 2020 at 14:56 Comment(0)
I
4

proguard-android-optimize.txt sometimes is unsupported so using the following is safer (see this):

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
Iamb answered 18/9, 2021 at 16:20 Comment(0)
N
0

But, after enabling "Minify enabled: true", many features like firebase authentications were not working properly. Not only firebase, but also other dependencies are not work properly after enabling this. I have tried it. You can also once recheck it.

Nova answered 19/4, 2023 at 18:30 Comment(1)
How does this answer the question?Ping

© 2022 - 2024 — McMap. All rights reserved.