dotnet / dotnet/android

Missing documentation on recommended release settings. D8andR8.md is likely outdated

Open
#8,917 3 comments 0 reactions 2 assignees Claimed by @jonathanpeppers View on GitHub
Area: App+Library Build Area: Documentation
Dominant language
C#
Stars
2.1k
Forks
579
Avg merge
1d 20h
Merged PRs (30d)
257

Description

### Android application type

.NET Android (net7.0-android, net8.0-android, etc.)

### Affected platform version

Not relevant

### Description

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:
- https://learn.microsoft.com/en-us/previous-versions/xamarin/android/deploy-test/release-prep/?tabs=windows
- https://learn.microsoft.com/en-us/previous-versions/xamarin/android/deploy-test/release-prep/proguard?tabs=windows

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:
![image](https://github.com/xamarin/xamarin-android/assets/3463496/71c04524-5a74-4b36-bcee-f8be5a7abb8b)

However, I cannot find any documentation on the R8 shrinker becoming the new default. In the .NET for Android repo there is https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/D8andR8.md which was last updated 6 years ago.

That document says
> If AndroidDexTool is omitted, dx and CompileToDalvik should be used. Until D8/R8 integration is deemed stable and enabled by default.

However, that was 6 years ago...

What are the recommended settings for releasing a .NET for Android / MAUI Android app today?

### Steps to Reproduce

Not applicable

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.