You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing documentation on recommended release settings. D8andR8.md is likely outdated #8917
This is a documentation issue - I would like to know what optimization settings are recommended when publishing a Release version to the Google Play store.
For Xamarin there was a lot of detailed documentation:
For .NET MAUI there is no equivalent about what settings to use, and in Visual Studio it looks like R8 is the only recommended code shrinker now. I cannot find a ProGuard option in the project settings and the only shrinker option in Visual Studio is R8:
changed the title [-]D8/R8 documentation likely outdated[/-][+]Missing documentation on recommended release settings. D8andR8.md is likely outdated[/+]on May 1, 2024
R8 is the equivalent of ProGuard, so that is optional. It would trim unused Java code, but you might have to add some ProGuard rules (same format as before). Not all apps will work with R8 enabled, without adding a few rules.
There might be a section we could add here about this:
Are there any settings, other than code shrinking, that developers should consider applying when releasing their app?
Regarding the place for documentation - I would expect this to be in the general documentation of .NET for Android / .NET MAUI - not just in the migration documentation (for new developers this is important, too).
However, from that last page (VS Project Properties) it's not super clear what the implications are between R8 and ProGuard and how to use it:
As I understood your answer, R8 might need a similar approach (defining rules) to ProGuard:
R8 is the equivalent of ProGuard, so that is optional. It would trim unused Java code, but you might have to add some ProGuard rules (same format as before). Not all apps will work with R8 enabled, without adding a few rules.
@hansmbakker the suggestions for Release (and Debug for that matter) are the project template / just leave all the settings blank.
If you have some need beyond that: such as smaller app size (at the cost of extra work r8), or faster startup (at the cost of larger app "AOT everything"). You could consider other settings at that point.
Activity
[-]D8/R8 documentation likely outdated[/-][+]Missing documentation on recommended release settings. D8andR8.md is likely outdated[/+]jonathanpeppers commentedon May 1, 2024
Google no longer supports DX:
So when you build apps today, it uses D8.
R8 is the equivalent of ProGuard, so that is optional. It would trim unused Java code, but you might have to add some ProGuard rules (same format as before). Not all apps will work with R8 enabled, without adding a few rules.
There might be a section we could add here about this:
hansmbakker commentedon May 1, 2024
@jonathanpeppers thank you for the quick answer!
Are there any settings, other than code shrinking, that developers should consider applying when releasing their app?
Regarding the place for documentation - I would expect this to be in the general documentation of .NET for Android / .NET MAUI - not just in the migration documentation (for new developers this is important, too).
I found these pages:
However, from that last page (VS Project Properties) it's not super clear what the implications are between R8 and ProGuard and how to use it:

As I understood your answer, R8 might need a similar approach (defining rules) to ProGuard:
Please note, that for https://learn.microsoft.com/en-us/previous-versions/xamarin/android/deploy-test/release-prep/proguard?tabs=windows there is no replacement in the MAUI documentation either.
Furthermore, it does not feel like a clear and complete overview of suggested settings and things to keep in mind (besides the shrinking).
jonathanpeppers commentedon May 1, 2024
@hansmbakker the suggestions for
Release(andDebugfor that matter) are the project template / just leave all the settings blank.If you have some need beyond that: such as smaller app size (at the cost of extra work
r8), or faster startup (at the cost of larger app "AOT everything"). You could consider other settings at that point.