Skip to content

[.NET 10 / CoreCLR] ManagedPeerType <=> JniTypeName Mismatch! #10323

@filipnavara

Description

@filipnavara

Android framework version

net10.0-android (Preview)

Affected platform version

.NET 10 (commit 510fc08 of dotnet/android and matchin .NET runtime)

Description

Running the attached sample app (basically an empty MAUI app) produces the following warning at runtime:

07-23 09:52:34.685  8434  8434 D app_process64: WARNING-Java.Interop: ManagedPeerType <=> JniTypeName Mismatch! javaVM.GetJniTypeInfoForType(typeof(Android.Views.IWindowManagerInvoker)).JniTypeName="android/view/WindowManager" != "android/view/ViewManager"
07-23 09:52:34.695  8434  8434 D app_process64:    at Java.Interop.JniPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType, Boolean checkManagedPeerType, Boolean isInterface)
07-23 09:52:34.695  8434  8434 D app_process64:    at Java.Interop.JniPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType)
07-23 09:52:34.695  8434  8434 D app_process64:    at Android.Runtime.XAPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType)
07-23 09:52:34.695  8434  8434 D app_process64:    at Android.Views.IWindowManagerInvoker..cctor()
07-23 09:52:34.695  8434  8434 D app_process64:    at Android.Views.IWindowManagerInvoker.get_DefaultDisplay()
07-23 09:52:34.695  8434  8434 D app_process64:    at Microsoft.Maui.WindowOverlay.Initialize()
07-23 09:52:34.695  8434  8434 D app_process64:    at Microsoft.Maui.Handlers.WindowHandler.OnRootViewChanged(Object sender, EventArgs e)
07-23 09:52:34.695  8434  8434 D app_process64:    at Microsoft.Maui.Platform.NavigationRootManager.SetContentView(IView view)
07-23 09:52:34.695  8434  8434 D app_process64:    at Microsoft.Maui.Platform.NavigationRootManager.Connect(IView view, IMauiContext mauiContext)
07-23 09:52:34.695  8434  8434 D app_process64:    at Microsoft.Maui.Handlers.WindowHandler.CreateRootViewFromContent(IWindowHandler handler, IWindow window)
07-23 09:52:34.695  8434  8434 D app_process64:    at Microsoft.Maui.Handlers.WindowHandler.MapContent(IWindowHandler handler, IWindow window)
07-23 09:52:34.695  8434  8434 D app_process64:    at Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0.<Add>b__0(IElementH

Steps to Reproduce

  1. Compile emptymaui.zip app with dotnet build -f net10.0-android -p:UseMonoRuntime=false
  2. Deploy to simulator/device and observe logcat

Did you find any workaround?

No response

Relevant log output

Adding reference to Sentry and initializing it produces few more reproducible type mismatches (observed on our app):

07-23 09:58:38.883  8503  8503 W monodroid-assembly: typemap: managed type 'Sentry.JavaSdk.Sentry+IOptionsConfigurationInvoker' (hash 4a06171aebf8f732) not found in module [edd1f589-5147-4187-9fe0-56e2ff51b61b] (Sentry.Bindings.Android).
07-23 09:58:38.883  8503  8503 D app_process64: WARNING-Java.Interop: ManagedPeerType <=> JniTypeName Mismatch! javaVM.GetJniTypeInfoForType(typeof(Sentry.JavaSdk.Sentry+IOptionsConfigurationInvoker)).JniTypeName="" != "io/sentry/Sentry$OptionsConfiguration"
07-23 09:58:38.895  8503  8503 D app_process64:    at Java.Interop.JniPeerMembers..ctor(String, Type, Boolean, Boolean )
07-23 09:58:38.895  8503  8503 D app_process64:    at Java.Interop.JniPeerMembers..ctor(String, Type)
07-23 09:58:38.895  8503  8503 D app_process64:    at Sentry.JavaSdk.Sentry.IOptionsConfigurationInvoker..cctor()
07-23 09:58:38.895  8503  8503 D app_process64:    at Sentry.JavaSdk.Sentry.IOptionsConfigurationInvoker.GetConfigure_Lio_sentry_SentryOptions_Handler()
07-23 09:58:38.895  8503  8503 D app_process64:    at Android.Runtime.AndroidTypeManager.RegisterNativeMembers(JniType, Type , ReadOnlySpan`1 )
07-23 09:58:38.895  8503  8503 D app_process64:    at Android.Runtime.JNIEnvInit.RegisterJniNatives(IntPtr, Int32, IntPtr, IntPtr, Int32)
07-23 09:58:38.895  8503  8503 D app_process64:    at Java.Interop.JniEnvironment.Object.AllocObject(JniObjectReference)
07-23 09:58:38.895  8503  8503 D app_process64:    at Java.Interop.JniType.AllocObject()
07-23 09:58:38.895  8503  8503 D app_process64:    at Java.Interop.JniPeerMembers.JniInstanceMethods.StartCreateInstance(String, Type, JniArgumentValue* )
07-23 09:58:38.895  8503  8503 D app_process64:    at Java.Lang.Object..ctor()
07-23 09:58:38.895  8503  8503 D app_process64:    at Sentry.SentrySdk.InitSentryAndroidSdk(SentryOptions)
07-23 09:58:38.895  8503  8503 D app_process64:    at Sentry.SentrySdk.InitHub(SentryOptions)
07-23 09:58:38.895  8503  8503 D app_process64:    at Sentry.SentrySdk.Init(Action`1 )
07-23 09:58:38.895  8503  8503 D app_process64:    at MailClient.Mobile.Droid.AndroidApp.InitSentry(PlatformUtils platformUtils)
07-23 09:58:38.895  8503  8503 D app_process64:    at MailClient.Mobile.Droid.AndroidApp.InitializeApp(Context



07-23 09:58:38.995  8503  8503 D app_process64: WARNING-Java.Interop: ManagedPeerType <=> JniTypeName Mismatch! javaVM.GetJniTypeInfoForType(typeof(Android.Runtime.JavaList)).JniTypeName="java/util/ArrayList" != "java/util/List"
07-23 09:58:38.995  8503  8503 D app_process64:    at Java.Interop.JniPeerMembers..ctor(String, Type, Boolean, Boolean )
07-23 09:58:38.995  8503  8503 D app_process64:    at Android.Runtime.JavaList..cctor()
07-23 09:58:38.995  8503  8503 D app_process64:    at Android.Runtime.JavaList.Iterator()
07-23 09:58:38.995  8503  8503 D app_process64:    at Android.Runtime.JavaList`1.GetEnumerator()
07-23 09:58:38.995  8503  8503 D app_process64:    at Android.Runtime.JavaList`1.System.Collections.IEnumerable.GetEnumerator()
07-23 09:58:38.995  8503  8503 D app_process64:    at System.Linq.Enumerable.OfTypeIterator`1.MoveNext()
07-23 09:58:38.995  8503  8503 D app_process64:    at System.Linq.Enumerable.IEnumerableWhereIterator`1.MoveNext()
07-23 09:58:38.995  8503  8503 D app_process64:    at System.Linq.Enumerable.CastIterator[TResult](IEnumerable)+MoveNext()
07-23 09:58:38.995  8503  8503 D app_process64:    at System.Linq.Enumerable.TryGetFirstNonIterator[TSource](IEnumerable`1, Boolean& )
07-23 09:58:38.995  8503  8503 D app_process64:    at Sentry.Android.AndroidEventProcessor..ctor(SentryAndroidOptions)
07-23 09:58:38.995  8503  8503 D app_process64:    at Sentry.SentrySdk.InitSentryAndroidSdk(SentryOptions)
07-23 09:58:38.995  8503  8503 D app_process64:    at Sentry.SentrySdk.InitHub(SentryOptions)
07-23 09:58:38.995  8503  8503 D app_process64:    at Sentry.SentrySdk.Init(Action`1 )
07-23 09:58:38.995  8503  8503 D app_process64:    at MailClient.Mobile.Droid.AndroidApp.InitSentry(PlatformUtils platformUtils)
07-23 09:58:38.995  8503  8503 D app_process64:    at MailClient.Mobile.Droid.AndroidApp.InitializeApp(Context context)
07-23 09:58:38.995  8503  8503 D app_process64:    at MailClient.Mobile.Droid.AndroidApp.OnCreate()
07-23 09:58:38.995  8503  8503 D app_process64:    at Android.App.Application.n_O

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssues that need to be assigned.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions