A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
Hello @Vinit Bhandari ,
Thank you for providing the detailed information and for checking the contents of the generated AAB.
The r8.json file not being generated by the current .NET for Android workload is a known issue. This has been fixed, but the fix is not yet included in a released .NET 10 Android workload.
In the meantime, you can try the approach provided here to generate and include r8.json in your AAB: https://github.com/dotnet/android/pull/12646
Regarding your questions:
1. Does the released .NET 10 for Android workload support generating the r8.json metadata required by Google Play for code optimization reporting?
As of now, no.
2. If yes, what exact project configuration or MSBuild settings are required to generate r8.json?
Although the answer to the first question is no: you can still achieve this by using the workaround mentioned above.
3. If r8.json is not generated with our current configuration, is this expected behavior for .NET 10 for Android?
If by "expected behavior" you mean whether .NET for Android is intended to work this way, then no. This is considered an issue, and a fix has already been merged.
If you mean whether r8.json not being generated is expected with the currently released .NET 10 Android workload, then yes, since that workload does not yet include the
4. Will .NET 11 generate and package r8.json in a way that Google Play can use it to display the Shrinking, Optimization and Obfuscation percentages?
Since the fix has already been implemented, I would expect this to be supported in .NET 11. However, I cannot confirm this until the fix is included in a released .NET 11 Android workload
5. Most importantly: For a .NET for Android application, what is the earliest .NET Android version/workload where we can expect Google Play to receive the required R8 metadata and display the three optimization percentages instead of -?
The fix is coming to .NET 10 through the release/10.0.1xx servicing branch, but the workload containing it has not been released yet.
If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation. Thank you.