Xamarin-android: [Bug] Warning in Google Console when publishing an app from Visual Studio

Created on 5 Oct 2020  路  13Comments  路  Source: xamarin/xamarin-android

Description

When I published my app to the new (beta) Google console, i got two warnings, one of them was "This App Bundle contains Java/Kotlin code, which might be obfuscated."

I found this issue that describes my situation: https://github.com/apache/cordova-android/issues/1008

From what I read it seems that the publishing procedure inside visual studio needs to be updated to upload some additional file so this warning goes away.

App+Library Build bug

Most helpful comment

I did some investigation on this, if you include a custom Proguard rules file which contains the following

-printmapping mapping.txt

-keepattributes SourceFile
-keepattributes LineNumberTable

then add the file to the app project and give it a ProguardConfiguration Build Action.

This will generate the required mapping.txt file in your project root directory. I believe this is the file you need to upload to the developer console.

This worked for me, the alert disappeared when sending a new version of the app to Google Play.

All 13 comments

I'm facing the same issue

@sjorsmiltenburg and @juanferrgiraldo for now you can ignore this warning -- the new Google Play developer console has added this new warning.

We will look into generating the appropriate mapping.txt / proguard.map file. Thanks!

I did some investigation on this, if you include a custom Proguard rules file which contains the following

-printmapping mapping.txt

-keepattributes SourceFile
-keepattributes LineNumberTable

then add the file to the app project and give it a ProguardConfiguration Build Action.

This will generate the required mapping.txt file in your project root directory. I believe this is the file you need to upload to the developer console.

I guess that Xamarin.Android could make a new $(ProguardMappingFile) property that defaults to $(OutputPath)mapping.txt for Release builds:

https://support.google.com/googleplay/android-developer/answer/6295281?hl=en

@sjorsmiltenburg / @juanferrgiraldo can you try Dean's example for now and see if it works for your app? Thanks!

I did some investigation on this, if you include a custom Proguard rules file which contains the following

-printmapping mapping.txt

-keepattributes SourceFile
-keepattributes LineNumberTable

then add the file to the app project and give it a ProguardConfiguration Build Action.

This will generate the required mapping.txt file in your project root directory. I believe this is the file you need to upload to the developer console.

This worked for me, the alert disappeared when sending a new version of the app to Google Play.

@jonathanpeppers @dellis1972

During the reviewing apps publication and before the google validation I noticed these 2 warnings

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

This App Bundle contains native code, and you've not uploaded debug symbols We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug

I have never enabled Proguard in my app(as my app uses other third party libraries) . is it mandatory now to enable it now to get away from these warning . Please help me understand on how to fix this?

Thanks

This app bundle contains java/kotlin code which might be obfuscated

I think the keyword here is "might", they don't actually know if it is obfuscated or not. If you are not using AndroidLinkTool=r8 or AndroidLinkTool=proguard, you can ignore this one.

This App Bundle contains native code, and you've not uploaded debug symbols

Xamarin.Android includes native code, we could potentially have a way to get the symbols for it. This is also the case for AOT, as your code has been turned into native libraries (.so files).

It seems like there is something to do here for native libraries. @grendello / @radekdoulik is there a way to generate symbol files for AOT?

@jonathanpeppers ,

Thanks for your response.

I analyzed that, my Xamarin android app is using third-party sdk app(exposed via aar + some other jar files(i pre-assume its a native code). i see Type-Mapping file is being generated in the following path in third-party sdk app release folder(third-party sdk app folder\objRelease\type-mapping.tx which means Proguard is enabled in the third-party sdk app). However Proguard is not enabled in the main app. should this be the reason for first warning(This app bundle contains java/kotlin code which might be obfuscated).

Should i upload this mapping file itself to solve this problem for the main app bundle?

Thanks in advance.

For the second warning , i will wait for @grendello /@radekdoulik's reply (to check if there's any way to generate symbol files for AOT).

@jonathanpeppers ,

Could you please suggest your opinion on the above post?

Thanks in Advance

Yes, I think it would be fine to upload type-mapping.txt if you have other third party Java/Kotlin code that you don't know if it is obfuscated.

You could also just look inside the library to decide if it is actually obfuscated -- if it's not, you could just ignore the warning the Google Play console is giving. I think you can just drag .aar files into Android Studio to open them and inspect Java/Kotlin types.

@jonathanpeppers ,

Do we have anyway to identify and extract symbol file for debug symbols for the below error from google play

This App Bundle contains native code, and you've not uploaded debug symbols We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug

Thanks in Advance

Why is this closed? I'm still observing the same warning, as well as the one mentioned above - "This App Bundle contains native code, and you've not uploaded debug symbols.". I'm using VS 16.9.1. Is there anything additionally that I need to use, since I can't find any updates on the documentation for this as well?

We solved this for Java/Kotlin code. We are tracking the same for native C/C++ code here: https://github.com/xamarin/xamarin-android/issues/5378

Was this page helpful?
0 / 5 - 0 ratings