<configuration>
<packageSources>
<add key="local" value="C:\src\xamarin-android\bin\BuildDebug\nupkgs" />
...
12-14 08:50:08.286 11868 11868 D app_process32: ---- DEBUG ASSERTION FAILED ----
12-14 08:50:08.286 11868 11868 D app_process32: ---- Assert Short Message ----
12-14 08:50:08.286 11868 11868 D app_process32: ManagedPeerType <=> JniTypeName Mismatch! javaVM.GetJniTypeInfoForType(typeof(Android.Views.LayoutInflaterInvoker)).JniTypeName="" != "android/view/LayoutInflater"
12-14 08:50:08.286 11868 11868 D app_process32: ---- Assert Long Message ----
12-14 08:50:08.286 11868 11868 D app_process32:
12-14 08:50:08.286 11868 11868 D app_process32: at System.Diagnostics.DebugProvider.Fail(String message, String detailMessage)
12-14 08:50:08.286 11868 11868 D app_process32: at System.Diagnostics.Debug.Fail(String message, String detailMessage)
12-14 08:50:08.286 11868 11868 D app_process32: at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage)
12-14 08:50:08.286 11868 11868 D app_process32: at System.Diagnostics.Debug.Assert(Boolean condition, String message)
12-14 08:50:08.286 11868 11868 D app_process32: at Java.Interop.JniPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType, Boolean checkManagedPeerType, Boolean isInterface)
12-14 08:50:08.286 11868 11868 D app_process32: at Java.Interop.JniPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType)
12-14 08:50:08.286 11868 11868 D app_process32: at Android.Runtime.XAPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType)
12-14 08:50:08.286 11868 11868 D app_process32: at Android.Views.LayoutInflaterInvoker..cctor()
12-14 08:50:08.286 11868 11868 D app_process32: at System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstruct
12-14 08:50:08.290 11868 11868 W : CLR: Managed code called FailFast, saying "ManagedPeerType <=> JniTypeName Mismatch! javaVM.GetJniTypeInfoForType(typeof(Android.Views.LayoutInflaterInvoker)).JniTypeName="" != "android/view/LayoutInflater"
12-14 08:50:08.290 11868 11868 W : at System.Diagnostics.DebugProvider.Fail(String message, String detailMessage)
12-14 08:50:08.290 11868 11868 W : at System.Diagnostics.Debug.Fail(String message, String detailMessage)
12-14 08:50:08.290 11868 11868 W : at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage)
12-14 08:50:08.290 11868 11868 W : at System.Diagnostics.Debug.Assert(Boolean condition, String message)
12-14 08:50:08.290 11868 11868 W : at Java.Interop.JniPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType, Boolean checkManagedPeerType, Boolean isInterface)
12-14 08:50:08.290 11868 11868 W : at Java.Interop.JniPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType)
12-14 08:50:08.290 11868 11868 W : at Android.Runtime.XAPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType)
12-14 08:50:08.290 11868 11868 W : at Android.Views.LayoutInflaterInvoker..cctor()
12-14 08:50:08.290 11868 11868 W : at System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstructorInfo , Object , Object[] , Exception& )
12-14 08:50:08.290 11868 11868 W : at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object obj, Object[] parameters, Boolean wrapExceptions)
12-14 08:50:08.290 11868 11868 W : at System.Reflection.RuntimeConstructorInfo.DoInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
12-14 08:50:08.290 11868 11868 W : at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
12-14 08:50:08.290 11868 11868 W : at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
12-14 08:50:08.290 11868 11868 W : at Java.Interop.TypeManager.CreateProxy(Type type, IntPtr handle, JniHandleOwnership transfer)
12-14 08:50:08.290 11868 11868 W : at Java.Interop.TypeManager.CreateInstance(IntPtr handle, JniHandleOwnership transfer, Type targetType)
12-14 08:50:08.290 11868 11868 W : at Java.Lang.Object.GetObject(IntPtr handle, JniHandleOwnership transfer, Type type)
12-14 08:50:08.290 11868 11868 W : at Java.Lang.Object._GetObject[LayoutInflater](IntPtr handle, JniHandleOwnership transfer)
12-14 08:50:08.290 11868 11868 W : at Java.Lang.Object.GetObject[LayoutInflater](IntPtr handle, JniHandleOwnership transfer)
12-14 08:50:08.290 11868 11868 W : at Android.App.Activity.get_LayoutInflater()
12-14 08:50:08.290 11868 11868 W : at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnCreate(Bundle savedInstanceState, ActivationFlags flags)
12-14 08:50:08.290 11868 11868 W : at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnCreate(Bundle savedInstanceState)
12-14 08:50:08.290 11868 11868 W : at HelloForms.Droid.MainActivity.OnCreate(Bundle savedInstanceState)
12-14 08:50:08.290 11868 11868 W : at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState)
12-14 08:50:08.290 11868 11868 W : at Android.Runtime.DynamicMethodNameCounter.5(IntPtr , IntPtr , IntPtr )"
12-14 08:50:08.292 11868 11868 E mono :
12-14 08:50:08.292 11868 11868 E mono : Unhandled Exception:
12-14 08:50:08.292 11868 11868 E mono : System.Diagnostics.DebugProvider+DebugAssertException: ManagedPeerType <=> JniTypeName Mismatch! javaVM.GetJniTypeInfoForType(typeof(Android.Views.LayoutInflaterInvoker)).JniTypeName="" != "android/view/LayoutInflater"
12-14 08:50:08.292 11868 11868 E mono : at System.Diagnostics.DebugProvider.Fail(String message, String detailMessage)
12-14 08:50:08.292 11868 11868 E mono : at System.Diagnostics.Debug.Fail(String message, String detailMessage)
12-14 08:50:08.292 11868 11868 E mono : at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage)
12-14 08:50:08.292 11868 11868 E mono : at System.Diagnostics.Debug.Assert(Boolean condition, String message)
12-14 08:50:08.292 11868 11868 E mono : at Java.Interop.JniPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType, Boolean checkManagedPeerType, Boolean isInterface)
12-14 08:50:08.292 11868 11868 E mono : at Java.Interop.JniPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType)
12-14 08:50:08.292 11868 11868 E mono : at Android.Runtime.XAPeerMembers..ctor(String jniPeerTypeName, Type managedPeerType)
12-14 08:50:08.292 11868 11868 E mono : at Android.Views.LayoutInflaterInvoker..cctor()
12-14 08:50:08.292 11868 11868 E mono : at System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstructorInfo , Object , Object[] , Exception& )
12-14 08:50:08.292 11868 11868 E mono : at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object obj, Object[] parameters, Boolean wrapExceptions)
12-14 08:50:08.292 11868 11868 E mono : at System.Reflection.RuntimeConstructorInfo.DoInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
12-14 08:50:08.292 11868 11868 E mono : at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
12-14 08:50:08.292 11868 11868 E mono : at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
12-14 08:50:08.292 11868 11868 E mono : at Java.Interop.TypeManager.CreateProxy(Type type, IntPtr handle, JniHandleOwnership transfer)
12-14 08:50:08.292 11868 11868 E mono : at Java.Interop.TypeManager.CreateInstance(IntPtr handle, JniHandleOwnership transfer, Type targetType)
12-14 08:50:08.292 11868 11868 E mono : at Java.Lang.Object.GetObject(IntPtr handle, JniHandleOwnership transfer, Type type)
12-14 08:50:08.292 11868 11868 E mono : at Java.Lang.Object._GetObject[LayoutInflater](IntPtr handle, JniHandleOwnership transfer)
12-14 08:50:08.292 11868 11868 E mono : at Java.Lang.Object.GetObject[LayoutInflater](IntPtr handle, JniHandleOwnership transfer)
12-14 08:50:08.292 11868 11868 E mono : at Android.App.Activity.get_LayoutInflater()
12-14 08:50:08.292 11868 11868 E mono : at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnCreate(Bundle savedInstanceState, ActivationFlags flags)
12-14 08:50:08.292 11868 11868 E mono : at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnCreate(Bundle savedInstanceState)
12-14 08:50:08.292 11868 11868 E mono : at HelloForms.Droid.MainActivity.OnCreate(Bundle savedInstanceState)
12-14 08:50:08.292 11868 11868 E mono : at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState)
12-14 08:50:08.292 11868 11868 E mono : at Android.Runtime.DynamicMethodNameCounter.5(IntPtr , IntPtr , IntPtr )
We probably won't be able to look into this until January, so I thought I'd post this so we don't forget.
Steps to Reproduce
Build a Debug build of xamarin-android locally with
msbuild Xamarin.Android.sln -t:PackDotNetormake pack-dotnetBuild this Xamarin.Forms sample:
~\android-toolchain\dotnet\dotnet build .\HelloForms\HelloForms.csproj -t:Run -p:TargetFramework=net6.0-android
You may need to add an entry to
NuGet.config, full path to:Crashes with:
This works if you have a
Releasebuild ofJava.Interop.dllbecause this assertion is stripped away:https://github.com/xamarin/java.interop/blob/2f62ffd4367870802f146c7957a94839daf1b86d/src/Java.Interop/Java.Interop/JniPeerMembers.cs#L27-L34
We think there must be some issue with type maps in this project?
We probably won't be able to look into this until January, so I thought I'd post this so we don't forget.