Share via

Android.Runtime.JavaProxyThrowable when run the android ?

mc 6,801 Reputation points
2026-03-03T12:22:49.16+00:00

I am using .net Maui 10.0 and when I start android there will be error :Android.Runtime.JavaProxyThrowable and I searched the google and get:

1.add XamlCompileOptions.Skip in MainPage and App.xamls.cs and APpshell.Xamls.cs.

  1. do not use native aot.

but there still the error why? just in android in ios is ok.

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

Answer accepted by question author
  1. Nancy Vo (WICLOUD CORPORATION) 880 Reputation points Microsoft External Staff Moderator
    2026-03-04T03:19:50.43+00:00

    Hi @mc ,

    Thanks for reaching out.

    I want to clarify that Android.Runtime.JavaProxyThrowable is not the actual root cause, it's just a wrapper exception that Android throws when a .NET exception crosses from managed code. That's why you should check the real error from the output window, scroll above JavaProxyThrowable and look for it.

    Furthermore, add XamlCompileOptions.Skip will not resolve this issue because it only disables XAML compilation, and disabling Native AOT also rarely fixes this issue.

    I recommend some common solutions to try:

    1. The most common cause of JavaProxyThrowable in MAUI 10 Android is aggressive code trimming. According to Microsoft's documentation on linking .NET MAUI Android apps, you should adjust your linker settings. Add this to your .csproj file inside a <PropertyGroup> for Android:
    <PropertyGroup Condition="'$(TargetFramework)' == 'net10.0-android'">
      <AndroidLinkMode>SdkOnly</AndroidLinkMode>
      <TrimMode>partial</TrimMode>
    </PropertyGroup>
    

    After making these changes, close Visual Studio, delete bin and obj folders from your project, uninstall the app from your Android device/emulator, rebuild and redeploy.

    1. If you call API, add to Platforms/Android/AndroidManifest.xml this:

    <uses-permission android:name="android.permission.INTERNET" />

    1. If you forgot to register a service in the Dependency Injection: builder.Services.AddSingleton<MyService>();

    Android sometimes crashes differently than iOS.

    Note: If you’d like me to take a closer look, please provide stack trace and error message from the output window to help me reproduce the issue.

    Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well. Thanks for your time.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

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.