1

I have a Xamarin ListView with custom ViewCellRenderer. Until an Android 7.1 all works fine. From Android 8.0 this error occurs when I try to show the ListView.

Stack:

01-25 07:52:45.881 I/MonoDroid( 1796): UNHANDLED EXCEPTION: 01-25 07:52:45.884 I/MonoDroid( 1796): System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.ListViewAdapter from native handle 0xffb2ba4c (key_handle 0x12b402c). ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Platform.Android.ListViewAdapter::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> J ava.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown. 01-25 07:52:45.884 I/MonoDroid( 1796): --- End of inner exception stack trace --- 01-25 07:52:45.884 I/MonoDroid( 1796): at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00054] in <8211f1f12f9e45838d631abf63e51c79>:0 01-25 07:52:45.884 I/MonoDroid( 1796): at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00111] in <8211f1f12f9e45838d631abf63e51c79>:0 01-25 07:52:45.884 I/MonoDroid( 1796): --- End of inner exception stack trace --- 01-25 07:52:45.884 I/MonoDroid( 1796): at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x0017d] in <8211f1f12f9e45838d631abf63e51c79>:0 01-25 07:52:45.884 I/MonoDroid( 1796): at Java.Lang.Object.GetObject (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type type) [0x000b9] in <8211f1f12f9e45838d631abf63e51c79>:0 01-25 07:52:45.884 I/MonoDroid( 1796): at Java.Lang.Object._GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00017] in <8211f1f12f9e45838d631abf63e51c79>:0 01-25 07:52:45.884 I/MonoDroid( 1796): at Java.Lang.Object.GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00000] in <8211f1f12f9e45838d631abf63e51c79>:0 01-25 07:52:45.884 I/MonoDroid( 1796): at Java.Lang.Object.GetObject[T] (System.IntPtr jnienv, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00006] in <8211f1f12f9e45838d631abf63e51c79>:0 01-25 07:52:45.884 I/MonoDroid( 1796): at Android.Widget.BaseAdapter.n_GetCount (System.IntPtr jnienv, System.IntPtr native__this) [0x00000] in <8211f1f12f9e45838d631abf63e51c79>:0 01-25 07:52:45.884 I/MonoDroid( 1796): at (wrapper dynamic-method) System.Object:7deaaa48-5ec9-40a5-ae19-b84f06973113 (intptr,intptr) 01-25 07:52:45.888 W/zygote ( 1796): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable 01-25 07:52:45.890 D/Mono ( 1796): DllImport searching in: '__Internal' ('(null)'). 01-25 07:52:45.890 D/Mono ( 1796): Searching for 'java_interop_jnienv_throw'. 01-25 07:52:45.890 D/Mono ( 1796): Probing 'java_interop_jnienv_throw'. 01-25 07:52:45.890 D/Mono ( 1796): Found as 'java_interop_jnienv_throw'.

Unhandled Exception:

System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.ListViewAdapter from native handle 0xffb2ba4c (key_handle 0x12b402c).

This is a GIF about the problem: enter image description here

How can I solve this?

Thank you!

1
  • Add the missing constructor. Kindly refer this link for further information. Commented Oct 11, 2021 at 7:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.