title: DefaultRenderer error in xamarin.forms (Android)
body: <p>I am using xamarin forms... And sometimes when I try to go back to my previous page I see this (Android device):</p>
  
  <blockquote>
    <p>System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.Platform+DefaultRenderer from native handle 0xbeb4a30c </p>
  </blockquote>
  
  <p>I saw this same issue with label renderer and box renderer but I solved it by creating a constructor in a custom renderer as the link below suggests:</p>
  
  <p><a href="https://stackoverflow.com/questions/10593022/monodroid-error-when-calling-constructor-of-custom-view-twodscrollview">MonoDroid: Error when calling constructor of custom view - TwoDScrollView</a></p>
  
  <p>But there's nothing about DefaultRenderer error as all where I have searched in for these last 30 days...I am getting crazy...</p>
  
  <p>complete exception:</p>
  
  <pre><code>System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.Platform+DefaultRenderer from native handle 0xbecdf3ac (key_handle 0x24da7695).
  
  04-04 11:51:53.914 D/Mono    (30832): DllImport attempting to load: '/system/lib/liblog.so'. 04-04 11:51:53.914 D/Mono    (30832): DllImport loaded library '/system/lib/liblog.so'. 04-04 11:51:53.914 D/Mono    (30832): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so'). 04-04 11:51:53.914 D/Mono    (30832): Searching for '__android_log_print'. 04-04 11:51:53.914 D/Mono    (30832): Probing '__android_log_print'. 04-04 11:51:53.914 D/Mono    (30832): Found as '__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: Unable to activate instance of type Xamarin.Forms.Platform.Android.Platform+DefaultRenderer from native handle 0xbecdf3ac (key_handle 0x24da7695). ---&gt; System.MissingMethodException: No constructor found for Xamarin.Forms.Platform.Android.Platform+DefaultRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---&gt; Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown. 04-04 11:51:53.944 I/MonoDroid(30832):    --- End of inner exception stack trace --- 04-04 11:51:53.944 I/MonoDroid(30832):   at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00054] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:51:53.944 I/MonoDroid(30832):   at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00111] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:51:53.944 I/MonoDroid(30832):    --- End of inner exception stack trace --- 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 &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:51:53.944 I/MonoDroid(30832):   at Java.Lang.Object.GetObject (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type type) [0x000b9] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:51:53.944 I/MonoDroid(30832):   at Java.Lang.Object._GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00017] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;: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 &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;: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 &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:51:53.944 I/MonoDroid(30832):   at Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00000] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:51:53.944 I/MonoDroid(30832):   at (wrapper dynamic-method) System.Object:cce836e4-e6e4-4d51-a0da-36412953d80b (intptr,intptr,intptr) 04-04 11:51:53.964 W/art     (30832): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable 04-04 11:51:53.964 D/Mono    (30832): DllImport searching in: '__Internal' ('(null)'). 04-04 11:51:53.964 D/Mono    (30832): Searching for 'java_interop_jnienv_throw'. 04-04 11:51:53.964 D/Mono    (30832): Probing 'java_interop_jnienv_throw'. 04-04 11:51:53.964 D/Mono    (30832): Found as 'java_interop_jnienv_throw'. Unhandled Exception:
  
  System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.Platform+DefaultRenderer from native handle 0xbecdf3ac (key_handle 0x24da7695).
  
  04-04 11:51:57.014 I/art     (30832): Thread[2,tid=30839,WaitingInMainSignalCatcherLoop,Thread*=0xaf90e400,peer=0x12c4d080,"Signal Catcher"]: reacting to signal 3 04-04 11:51:57.584 I/art     (30832): Wrote stack traces to '/data/anr/traces.txt' 04-04 11:52:07.844 I/MonoDroid(30832): UNHANDLED EXCEPTION: 04-04 11:52:07.894 I/MonoDroid(30832): System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.Platform+DefaultRenderer from native handle 0xbecdf3ac (key_handle 0x24da7695). ---&gt; System.MissingMethodException: No constructor found for Xamarin.Forms.Platform.Android.Platform+DefaultRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---&gt; Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown. 04-04 11:52:07.894 I/MonoDroid(30832):    --- End of inner exception stack trace --- 04-04 11:52:07.894 I/MonoDroid(30832):   at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00054] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:52:07.894 I/MonoDroid(30832):   at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00111] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:52:07.894 I/MonoDroid(30832):    --- End of inner exception stack trace --- 04-04 11:52:07.894 I/MonoDroid(30832):   at (wrapper dynamic-method) System.Object:cce836e4-e6e4-4d51-a0da-36412953d80b (intptr,intptr,intptr) 04-04 11:52:07.894 I/MonoDroid(30832):   at (wrapper managed-to-native) Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a (intptr,intptr&amp;,intptr,intptr,intptr,Java.Interop.JniArgumentValue*) 04-04 11:52:07.894 I/MonoDroid(30832):   at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00073] in &lt;e8c0e16a54534fa885244f0ad837c79e&gt;: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 &lt;e8c0e16a54534fa885244f0ad837c79e&gt;:0  04-04 11:52:07.894 I/MonoDroid(30832):   at Android.Views.ViewGroup.RemoveAllViews () [0x0000a] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:52:07.894 I/MonoDroid(30832):   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00088] in D:\agent_work\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:238 04-04 11:52:07.894 I/MonoDroid(30832):   at Java.Lang.Object.Dispose () [0x00000] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:52:07.894 I/MonoDroid(30832):   at Xamarin.Forms.Platform.Android.ListViewRenderer.ClearRenderer (Android.Views.View renderedView) [0x00032] in 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] in 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 &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:52:07.894 I/MonoDroid(30832):   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x0007b] in 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 &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:52:07.894 I/MonoDroid(30832):   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x0007b] in D:\agent_work\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234 04-04 11:52:07.894 I/MonoDroid(30832):   at Xamarin.Forms.Platform.Android.PageRenderer.Dispose (System.Boolean disposing) [0x00011] in D:\agent_work\1\s\Xamarin.Forms.Platform.Android\Renderers\PageRenderer.cs:33 04-04 11:52:07.894 I/MonoDroid(30832):   at Java.Lang.Object.Dispose () [0x00000] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0  04-04 11:52:07.894 I/MonoDroid(30832):   at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnDestroyView () [0x0003c] in D:\agent_work\1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:91 04-04 11:52:07.894 I/MonoDroid(30832):   at Android.Support.V4.App.Fragment.n_OnDestroyView (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in &lt;1e89c43d3c7d48b5ba69bfc0b1bdf114&gt;:0  04-04 11:52:07.894 I/MonoDroid(30832):   at (wrapper dynamic-method) 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 &lt;unknown&gt; &lt;0xffffffff&gt; 04-04 11:52:07.914 E/mono-rt (30832):   at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_new_string (intptr,intptr&amp;,char*,int) &lt;0x00043&gt; 04-04 11:52:07.914 E/mono-rt (30832):   at Java.Interop.JniEnvironment/Strings.NewString (char*,int) [0x00009] in &lt;e8c0e16a54534fa885244f0ad837c79e&gt;:0 04-04 11:52:07.924 E/mono-rt (30832):   at Java.Interop.JniEnvironment/Strings.NewString (string) [0x00024] in &lt;e8c0e16a54534fa885244f0ad837c79e&gt;:0 04-04 11:52:07.924 E/mono-rt (30832):   at Android.Runtime.JNIEnv.NewString (string) [0x0000a] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0 04-04 11:52:07.924 E/mono-rt (30832):   at Java.Lang.Error..ctor (string) [0x00020] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0 04-04 11:52:07.924 E/mono-rt (30832):   at Android.Runtime.JavaProxyThrowable..ctor (System.Exception) [0x00007] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0 04-04 11:52:07.924 E/mono-rt (30832):   at Java.Lang.Throwable.FromException (System.Exception) [0x0001e] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0 04-04 11:52:07.924 E/mono-rt (30832):   at Android.Runtime.AndroidEnvironment.UnhandledException (System.Exception) [0x00068] in &lt;e79c73bcbbb547688bef6c7e9665c95e&gt;:0 04-04 11:52:07.924 E/mono-rt (30832):   at (wrapper dynamic-method) object.1df32498-cacf-4686-8c6a-cd4a5d878faf (intptr,intptr) [0x00029] in &lt;657aa8fea4454dc898a9e5f379c58734&gt;: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 &lt;657aa8fea4454dc898a9e5f379c58734&gt;:0 04-04 11:52:07.924 E/mono-rt (30832): /proc/self/maps:
  </code></pre>