Release mode for a NET9 MAUI failed to find entry classes.dex

Enrico Rossini 236 Reputation points
2025-11-16T00:01:24.3666667+00:00

I have my application written with NET9 MAUI. I use Visual Studio 2026. The application is working in debug. When I deploy in Release, the application crashes immediately. The error log is quite long, but I think this is the relevant part immediately at the beginning:

The program 'LanguageInUse.dll' has exited with code 0 (0x0). New vsdbg debugger process created for project 'C:\Projects\ERDevOps\LIUApp9\LanguageInUse\LanguageInUse.csproj'... Starting vsdbg debug session for project 'C:\Projects\ERDevOps\LIUApp9\LanguageInUse\LanguageInUse.csproj'...

am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.languageinuse.app/crc64ac7aba82500a106d.MainActivity" Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.languageinuse.app/crc64ac7aba82500a106d.MainActivity }

Android application is running (debug is disabled in android project properties). 11-15 23:44:38.848 W/zygote64( 3604): Activation of cgroup controller +memory failed in path /sys/fs/cgroup/apps/uid_10362: Invalid argument 11-15 23:44:38.855 I/Zygote ( 3604): Process 3604 crated for com.languageinuse.app 11-15 23:44:38.855 I/nguageinuse.app( 3604): Using CollectorTypeCMC GC. 11-15 23:44:38.858 E/nguageinuse.app( 3604): Not starting debugger since process cannot load the jdwp agent. 11-15 23:44:38.860 D/nativeloader( 3604): Load libframework-connectivity-tiramisu-jni.so using APEX ns com_android_tethering for caller /apex/com.android.tethering/javalib/framework-connectivity-t.jar: ok 11-15 23:44:38.873 D/ApplicationLoaders( 3604): Returning zygote-cached class loader: /system/framework/org.apache.http.legacy.jar 11-15 23:44:38.873 D/ApplicationLoaders( 3604): Returning zygote-cached class loader: /system_ext/framework/androidx.window.extensions.jar 11-15 23:44:38.873 D/ApplicationLoaders( 3604): Returning zygote-cached class loader: /system_ext/framework/androidx.window.sidecar.jar 11-15 23:44:38.874 W/nguageinuse.app( 3604): Failed to find entry 'classes.dex': Entry not found 11-15 23:44:38.875 W/nguageinuse.app( 3604): Failed to find entry 'classes.dex': Entry not found 11-15 23:44:38.875 W/nguageinuse.app( 3604): Failed to find entry 'classes.dex': Entry not found

The MainActivity.cs is define like the following

[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop,
    ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | 
                           ConfigChanges.UiMode | ConfigChanges.ScreenLayout | 
                           ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
[IntentFilter(new[] { Platform.Intent.ActionAppAction },
          Categories = new[] { global::Android.Content.Intent.CategoryDefault })]
[IntentFilter(new[] { Intent.ActionView },
Categories = new[]
{
    Intent.ActionView,
    Intent.CategoryDefault,
    Intent.CategoryBrowsable,
},
DataScheme = "liu", DataHost = "", DataPathPrefix = "/")]
public class MainActivity : MauiAppCompatActivity
{
    // code
}

I have already deployed the application on the Google Play in its previous version, and it works.

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jack Dang (WICLOUD CORPORATION) 3,965 Reputation points Microsoft External Staff Moderator
    2025-11-17T04:21:27.2666667+00:00

    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:

    1. Disable Code shrinker
    2. Set Linking = SDK Assemblies Only
    3. Delete bin and obj, rebuild, and redeploy
    4. 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.

    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.