.NET 10 for Android: R8 Metadata (r8.json) and Google Play Code Optimization Reporting

Vinit Bhandari 0 Reputation points
2026-09-29T05:50:37.32+00:00

I am using .NET 10 for Android with the following target framework:

Target Framework: net10.0-android36.0

We are working on optimizing the application according to Google's DEX code optimization requirements:

https://developer.android.com/topic/performance/issues/code-optimization

Current Release Configuration:





With this configuration, our uncompressed DEX size was reduced from approximately 26.9 MB to 13.7 MB.

However, Google Play/Android optimization reporting currently does not show any percentage for Shrinking / Optimization / Obfuscation.

For comparison, the previous build without the above R8 configuration was showing 1% for Obfuscation.

I have verified that our build currently generates the ProGuard/R8 mapping file (proguard.map), but I do not currently see r8.json in the generated output/AAB.

According to Google's documentation: [Reference Link: https://developer.android.com/google/play/vitals/code-optimization ]

  • For apps built with the latest patch of AGP version 8.10 or higher, the optimization percentages are obtained from the included r8.json file.
  • For lower AGP versions, or when r8.json is not included, the percentages can be calculated from mapping.txt when available, or using DEX heuristics when the mapping file is not available.

What we have already checked

We unzipped the generated Android App Bundle (.aab) and inspected the BUNDLE-METADATA directory.

For our current build, with the above R8 configuration the AAB contains the following:

BUNDLE-METADATA/com.android.tools.build.obfuscation/proguard.map

The proguard.map file is present and generated successfully.

However, we do not see an r8.json file anywhere in the generated AAB, including the BUNDLE-METADATA directory.

Based on the generated AAB contents, our current .NET 10 Android build is packaging the ProGuard/R8 mapping file, but we have not been able to get the r8.json R8 optimization metadata packaged into the AAB.

As a result, Google Play currently displays - for the Obfuscation percentage rather than a percentage.

I would like to know the following:

  1. Does the released .NET 10 for Android workload support generating the r8.json metadata required by Google Play for code optimization reporting?
  2. If yes, what exact project configuration or MSBuild settings are required to generate r8.json?
  3. If r8.json is not generated with our current configuration, is this expected behavior for .NET 10 for Android?
  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?
  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 -?

Our main objective is to understand what needs to be done on the .NET Android build side so that Google Play can report Shrinking, Optimization, and Obfuscation percentages instead of -, while continuing to use R8 code shrinking.

Environment:

  • .NET 10
  • net10.0-android36.0
  • Release build
  • Android App Bundle (.aab)
  • R8 enabled
  • AndroidLinkMode=SdkOnly
  • PublishTrimmed=true
  • proguard.map: generated
  • r8.json: currently not observed in the AAB
  • DEX Size Before Optimization: ~26.9 MB
  • DEX Size After Optimization: ~13.7 MB
Developer technologies | .NET | .NET Multi-platform App UI
0 comments No comments

1 answer

Sort by: Most helpful
  1. Nguyen Dam (WICLOUD CORPORATION) 505 Reputation points Microsoft External Staff Moderator
    2026-09-29T06:11:32.7366667+00:00

    Thank you for your detailed information. I will update this with a more complete answer, and I appreciate your understanding in the meantime.

    As a quick answer: with the currently released .NET 10 Android workload, the missing r8.json is expected and there is no project configuration required to enable it. Support for generating and including this R8 metadata has since been implemented in .NET for Android, including a backport to the .NET 10 servicing branch.

    You can track the relevant changes here:

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.