Hi @Enrico Rossini ,
Thanks for reaching out.
The error “Failed to find entry 'classes.dex'” in a Release build usually indicates that some required Android classes were removed or not packaged correctly during the Release build process. This often happens due to code shrinking (R8), linking, or certain binding libraries behaving differently compared to Debug mode.
Below are the key areas to check:
1. Disable Code Shrinking (R8 / ProGuard)
In Release mode, Android’s code shrinker may remove Java classes required at runtime.
Please set the Code shrinker to None under:
Project Properties → Android → Packaging
https://learn.microsoft.com/en-us/dotnet/maui/deployment/visual-studio-properties?view=net-maui-10.0
2. Adjust Linking (ILLinker)
The .NET linker can strip assemblies or types needed during app startup.
Please set Linking to SDK Assemblies Only (or Don’t link to test).
https://learn.microsoft.com/en-us/dotnet/maui/android/linking
3. Clean and Rebuild the Project
Leftover bin/ and obj/ files may contain stale or incomplete dex artifacts.
Please manually delete bin and obj folders, then rebuild and redeploy.
https://learn.microsoft.com/en-us/dotnet/maui/troubleshooting?view=net-maui-10.0
4. Check Android Binding Libraries
If your project uses .jar or .aar binding libraries, they may fail to package dex files correctly in Release mode.
Temporarily remove or disable such libraries to see if they cause the issue.
https://learn.microsoft.com/en-us/dotnet/android/binding-libs/binding-java-libs/binding-java-library
5. Uninstall Previous App Versions
If a previous Debug or Production version of the app is installed, Android may mix artifacts from different builds.
Uninstall the app completely, then deploy the new Release build.
https://learn.microsoft.com/en-us/dotnet/maui/android/deployment?view=net-maui-10.0
6. Disable AOT or Trimming (If Enabled)
If AOT or aggressive trimming was manually enabled in the .csproj, it may result in missing dex entries during packaging.
Please disable these settings temporarily while debugging.
https://learn.microsoft.com/en-us/dotnet/maui/deployment/nativeaot?view=net-maui-9.0
Recommended First Steps
I suggest trying these in order:
- Disable Code shrinker
- Set Linking = SDK Assemblies Only
- Delete
binandobj, rebuild, and redeploy - Uninstall any previous installation of the app from the device
If the issue still occurs after that, feel free to share your Release configuration from the .csproj and the full packaging log, and I’ll help analyze it further.
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.