xamarin.forms中的DefaultRenderer错误(Android)

我正在使用xamarin表单...有时当我尝试回到我的上一页时,我看到了这个(Android设备):

System.NotSupportedException:无法从本机句柄0xbeb4a30c激活Xamarin.Forms.Platform.Android.Platform类型的DefaultRenderer类型的实例

我在标签渲染器和框渲染器中看到了同样的问题,但我解决了在自定义渲染器中创建构造函数的问题,因为下链接建议:

MonoDroid: Error when calling constructor of custom view - TwoDScrollView

但是没有关于DefaultRenderer错误的信息,就像我过去30天搜索过的所有内容一样......我疯了......

完全例外:

System.NotSupportedException:无法从本机句柄0xbecdf3ac(key_handle 0x24da7695)激活Xamarin.Forms.Platform.Android.Platform类型DefaultRenderer的实例 . 04-04 11:51:53.914 D / Mono(30832):DllImport尝试加载:'/ system / lib / liblog.so' . 04-04 11:51:53.914 D / Mono(30832):DllImport加载库'/system/lib/liblog.so' . 04-04 11:51:53.914 D / Mono(30832):DllImport搜索:'/ system / lib / liblog.so'('/ system / lib / liblog.so') . 04-04 11:51:53.914 D / Mono(30832):搜索'__android_log_print' . 04-04 11:51:53.914 D / Mono(30832):探测'__android_log_print' . 04-04 11:51:53.914 D / Mono(30832):找到'android_log_print' . 04-04 11:51:53.924 I / MonoDroid(30832):UNHANDLED EXCEPTION:04-04 11:51:53.944 I / MonoDroid(30832):System.NotSupportedException:无法激活Xamarin.Forms.Platform.Android类型的实例.Platform来自本机句柄0xbecdf3ac(key_handle 0x24da7695)的DefaultRenderer . ---> System.MissingMethodException:找不到Xamarin.Forms.Platform.Android.Platform的构造函数DefaultRenderer :: . ctor(System.IntPtr,Android.Runtime.JniHandleOwnership)---> Java.Interop.JavaLocationException:类型异常抛出了'Java.Interop.JavaLocationException' . 04-04 11:51:53.944 I / MonoDroid(30832):---内部异常堆栈跟踪结束--- 04-04 11:51:53.944 I / MonoDroid(30832):at Java.Interop.TypeManager.CreateProxy (System.Type类型,System.IntPtr句柄,Android.Runtime.JniHandleOwnership传输)[0x00054] in:0 04-04 11:51:53.944 I / MonoDroid(30832):at Java.Interop.TypeManager.CreateInstance(System . IntPtr句柄,Android.Runtime.JniHandleOwnership transfer,System.Type targetType)[0x00111] in:0 04-04 11:51:53.944 I / MonoDroid(30832):---内部异常堆栈跟踪结束--- 04- 04 11:51:53.944 I / MonoDroid(30832):at Java.Interop.TypeManager.CreateInstance(System.IntPtr handle,Android.Runtime.JniHandleOwnership transfer,System.Type targetType)[0x0017d] in:0 04-04 11: 51:53.944 I / MonoDroid(30832):在Java.Lang.Object.GetObject(System.IntPtr句柄,Android.Runtime.JniHandleOwnership transfer,System.Type类型)[0x000b9]中:0 04-04 11:51:53.944 I / MonoDroid(30832):在Java.Lang.Object.GetObject [T](System.IntPtr句柄,Android . Runtime.JniHandleOwnership transfer)[0x00017] in:0 04-04 11:51:53.944 I / MonoDroid(30832):at Java.Lang.Object.GetObject [T](System.IntPtr handle,Android.Runtime.JniHandleOwnership transfer) [0x00000] in:0 04-04 11:51:53.944 I / MonoDroid(30832):at Java.Lang.Object.GetObject [T](System.IntPtr jnienv,System.IntPtr handle,Android.Runtime.JniHandleOwnership transfer) [0x00006] in:0 04-04 11:51:53.944 I / MonoDroid(30832):在Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent(System.IntPtr jnienv,System.IntPtr native__this,System.IntPtr native_e)[0x00000]中: 0 04-04 11:51:53.944 I / MonoDroid(30832):at(包装器动态方法)System.Object:cce836e4-e6e4-4d51-a0da-36412953d80b(intptr,intptr,intptr)04-04 11:51: 53.964 W / art(30832):JNI RegisterNativeMethods:尝试为android.runtime.JavaProxyThrowable注册0本机方法04-04 11:51:53.964 D / Mono(30832):DllImport搜索:' Internal'('(null) “) . 04-04 11:51:53.964 D / Mono(30832):搜索'java_interop_jnienv_throw' . 04-04 11:51:53.964 D / Mono(30832):探测'java_interop_jnienv_throw' . 04-04 11:51:53.964 D / Mono(30832):找到'java_interop_jnienv_throw' . 未处理的异常:System.NotSupportedException:无法从本机句柄0xbecdf3ac(key_handle 0x24da7695)激活类型Xamarin.Forms.Platform.Android.Platform DefaultRenderer的实例 . 04-04 11:51:57.014 I / art(30832):线程[2,tid = 30839,WaitingInMainSignalCatcherLoop,Thread * = 0xaf90e400,peer = 0x12c4d080,“Signal Catcher”]:对信号做出反应3 04-04 11:51 :57.584 I / art(30832):将堆栈跟踪写入'/data/anr/traces.txt'04-04 11:52:07.844I / MonoDroid(30832):UNHANDLED EXCEPTION:04-04 11:52:07.894 I / MonoDroid(30832):System.NotSupportedException:无法从本机句柄0xbecdf3ac激活类型Xamarin.Forms.Platform.Android.Platform DefaultRenderer的实例( key_handle 0x24da7695) . ---> System.MissingMethodException:找不到Xamarin.Forms.Platform.Android.Platform的构造函数DefaultRenderer :: . ctor(System.IntPtr,Android.Runtime.JniHandleOwnership)---> Java.Interop.JavaLocationException:类型异常抛出了'Java.Interop.JavaLocationException' . 04-04 11:52:07.894 I / MonoDroid(30832):---内部异常堆栈跟踪结束--- 04-04 11:52:07.894 I / MonoDroid(30832):at Java.Interop.TypeManager.CreateProxy (System.Type类型,System.IntPtr句柄,Android.Runtime.JniHandleOwnership transfer)[0x00054] in:0 04-04 11:52:07.894 I / MonoDroid(30832):at Java.Interop.TypeManager.CreateInstance(System . IntPtr句柄,Android.Runtime.JniHandleOwnership transfer,System.Type targetType)[0x00111] in:0 04-04 11:52:07.894 I / MonoDroid(30832):---内部异常堆栈跟踪结束--- 04- 04 11:52:07.894 I / MonoDroid(30832):at(包装器动态方法)System.Object:cce836e4-e6e4-4d51-a0da-36412953d80b(intptr,intptr,intptr)04-04 11:52:07.894 I / MonoDroid(30832):at(包装器托管到本机)Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a(intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue *)04-04 11:52:07.894 I / MonoDroid (30832):at Java.Interop.JniEnvironment InstanceMethods.CallNonvirtualVoidMeth od(Java.Interop.JniObjectReference实例,Java.Interop.JniObjectReference类型,Java.Interop.JniMethodInfo方法,Java.Interop.JniArgumentValue * args)[0x00073] in:0 04-04 11:52:07.894 I / MonoDroid(30832) ):at Java.Interop.JniPeerMembers JniInstanceMethods.InvokeVirtualVoidMethod(System.String encodedMember,Java.Interop.IJavaPeerable self,Java.Interop.JniArgumentValue * parameters)[0x0005d] in:0 04-04 11:52:07.894 I / MonoDroid( 30832):在Android.Views.ViewGroup.RemoveAllViews()[0x0000a] in:0 04-04 11:52:07.894 I / MonoDroid(30832):at Xamarin.Forms.Platform.Android.VisualElementRenderer1 [TElement] .Dispose( System.Boolean disposing)[0x00088]在D:\ agent_work \ 1 \ s \ Xamarin.Forms.Platform.Android \ VisualElementRenderer.cs:238 04-04 11:52:07.894 I / MonoDroid(30832):at Java.Lang <e79c73bcbbb547688bef6c7e9665c95e>中的.Object.Dispose()[0x00000]:0 04-04 11:52:07.894 I / MonoDroid(30832):at Xamarin.Forms.Platform.Android.ListViewRenderer.ClearRenderer(Android.Views.View renderedView) [0X 000:在D:\ agent_work \ 1 \ s \ Xamarin.Forms.Platform.Android \ Renderers \ ListViewRenderer.cs:295 04-04 11:52:07.894 I / MonoDroid(30832):at Xamarin.Forms.Platform.Android .ListViewRenderer.Dispose(System.Boolean disposing)[0x0001e]在D:\ agent_work \ 1 \ s \ Xamarin.Forms.Platform.Android \ Renderers \ ListViewRenderer.cs:59 04-04 11:52:07.894 I / MonoDroid( 30832):at Java.Lang.Object.Dispose()[0x00000] in <e79c73bcbbb547688bef6c7e9665c95e>:0 04-04 11:52:07.894 I / MonoDroid(30832):at Xamarin.Forms.Platform.Android.VisualElementRenderer1 [TElement] .Dispose(System.Boolean disposing)[0x0007b]在D:\ agent_work \ 1 \ s \ Xamarin.Forms.Platform.Android \ VisualElementRenderer.cs:234 04-04 11:52:07.894 I / MonoDroid(30832):at Java.Lang.Object.Dispose()[0x00000] in:0 04-04 11:52:07.894 I / MonoDroid(30832):at Xamarin.Forms.Platform.Android.VisualElementRenderer`1 [TElement] .Dispose(System . 布尔处理)[0x0007b]在D:\ agent_work \ 1 \ s \ Xamarin.Forms.Platform.Android \ VisualElementRenderer.cs:234 04-04 11:52:07.8 94 I / MonoDroid(30832):在D:\ agent_work \ 1 \ s \ Xamarin.Forms.Platform.Android \ Renderers \ PageRenderer中的Xamarin.Forms.Platform.Android.PageRenderer.Dispose(System.Boolean disposing)[0x00011] .cs:33 04-04 11:52:07.894 I / MonoDroid(30832):at Java.Lang.Object.Dispose()[0x00000] in:0 04-04 11:52:07.894 I / MonoDroid(30832):在D:\ agent_work \ 1 \ s \ Xamarin.Forms.Platform.Android \ AppCompat \ FragmentContainer.cs中的Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnDestroyView()[0x0003c]:91 04-04 11:52 :07.894 I / MonoDroid(30832):在Android.Support.V4.App.Fragment.n_OnDestroyView(System.IntPtr jnienv,System.IntPtr native__this)[0x00008] in <1e89c43d3c7d48b5ba69bfc0b1bdf114>:0 04-04 11:52:07.894 I / MonoDroid(30832):at(包装器动态方法)System.Object:1df32498-cacf-4686-8c6a-cd4a5d878faf(intptr,intptr)04-04 11:52:07.914 E / mono-rt(30832):Stacktrace: 04-04 11:52:07.914 E / mono-rt(30832):04-04 11:52:07.914 E / mono-rt(30832):at<0xffffffff> 04-04 11:52:07.914 E / mono-rt(30832):at(包装器托管到原生)Java.Interop.NativeMethods.java_interop_jnienv_new_string(intptr,intptr&,char *,int)<0x00043> 04 -04 11:52:07.914 E / mono-rt(30832):at Java.Interop.JniEnvironment / Strings.NewString(char *,int)[0x00009] in:0 04-04 11:52:07.924 E / mono- rt(30832):at Java.Interop.JniEnvironment / Strings.NewString(string)[0x00024] in:0 04-04 11:52:07.924 E / mono-rt(30832):at Android.Runtime.JNIEnv.NewString(字符串)[0x0000a] in:0 04-04 11:52:07.924 E / mono-rt(30832):at Java.Lang.Error..ctor(string)[0x00020] in:0 04-04 11:52: 07.924 E / mono-rt(30832):在Android.Runtime.JavaProxyThrowable..ctor(System.Exception)[0x00007] in:0 04-04 11:52:07.924 E / mono-rt(30832):at Java . Lang.Throwable.FromException(System.Exception)[0x0001e] in:0 04-04 11:52:07.924 E / mono-rt(30832):at Android.Runtime.AndroidEnvironment.UnhandledException(System.Exception)[0x00068] in :0 04-04 11:52:07.924 E / mono-rt(30832):at(包装器dy namic-method)object.1df32498-cacf-4686-8c6a-cd4a5d878faf(intptr,intptr)[0x00029] in <657aa8fea4454dc898a9e5f379c58734>:0 04-04 11:52:07.924 E / mono-rt(30832):at(wrapper native -to-managed)object.1df32498-cacf-4686-8c6a-cd4a5d878faf(intptr,intptr)[0x00021] in <657aa8fea4454dc898a9e5f379c58734>:0 04-04 11:52:07.924 E / mono-rt(30832):/ proc /自/图:

回答(0)