我正在使用xamarin表单在android上开发应用程序。从几天以来,我得到了下面的问题。
Xamarin.Forms.Platform.Android.Platform+DefaultRenderer --> System.NotSupportedException:无法从本机句柄0xbeb0861c (key_handle 0xb3a225b)激活CurrentDomainOnUnhandledException类型的实例。05-02 14:36:57.973 i/mono(16628):System.Exception: CurrentDomainOnUnhandledException --> System.NotSupportedException:无法从本机句柄0xbeb0861c (key_handle 0xb3a225b)激活类型为System.NotSupportedException的实例。--内部异常堆栈跟踪的结束-- 05-02 14:36:57.975 I/mono(16628): --内部异常堆栈跟踪的结束--在Java.Interop.TypeManager.CreateProxy (System.Type类型、System.IntPtr句柄、Android.Runtime.JniHandleOwnership传输) 0x00054 in :0 05-02 14:36:57.978 I/mono-stdout(16628):at Java.Interop.TypeManager.CreateProxy (System.Type类型、System.IntPtr句柄、Android.Runtime.JniHandleOwnership传输) 0x00054 in :0 at Java.Interop.TypeManager.CreateInstance (System.IntPtr句柄、Android.Runtime.JniHandleOwnership传输,System.Type targetType) 0x00111 in :0 05-02 14:36:57.980 I/mono-stdout(16628):Java.Interop.TypeManager.CreateInstance (System.IntPtr句柄、Android.Runtime.JniHandleOwnership传输、System.Type targetType) 0x00111 in :0 -内部异常堆栈跟踪的末端- 05-02 14:36:57.982 I/mono-stdout(16628):Android.Runtime.JniHandleOwnership传输,System.Type targetType) 0x0017d in :0 05-02 14:36:57.984 I/mono(16628):at Java.Interop.TypeManager.CreateInstance (System.IntPtr句柄,Android.Runtime.JniHandleOwnership传输,System.Type targetType) 0x0017d in :0 at Java.Lang.Object.GetObject (System.IntPtr handle,Android.Runtime.JniHandleOwnership transfer )System.Type类型) 0x000b9 in :0 05-02 14:36:57.986 I/mono-stdout(16628):at Java.Lang.Object.GetObject (System.IntPtr句柄,Android.Runtime.JniHandleOwnership传输,System.Type类型) 0x000b9 in :0 at Java.Lang.Object._GetObjectT 0x00017 in :0 05-02 14:36:57.988 I/mono-stdout(16628):at Java.Lang.Object._GetObjectT 0x00017 in :0 在Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv,System.IntPtr native__this,System.IntPtr native_e) 0x00000 in :0 at at (包装器动态-方法) System.Object:3943ee27-49d5-404c-b2ef-5f107b52e084 (intptr,intptr,intptr) --内部异常堆栈跟踪的结束
发布于 2018-05-17 06:55:52
只需将构造函数添加到所有自定义呈现器即可完成。公共CustomEntryImageRenderer(IntPtr句柄,JniHandleOwnership传输){}
4.将下面的覆盖方法添加到自定义呈现器列表视图中。
protected override void Dispose(bool disposing)
{
Xamarin.Forms.Device.BeginInvokeOnMainThread(base.Dispose);
}https://stackoverflow.com/questions/50131073
复制相似问题