Bug 60525 - System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.LabelRenderer
Summary: System.NotSupportedException: Unable to activate instance of type Xamarin.For...
Status: RESOLVED DUPLICATE of bug 60507
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.4.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-11-06 14:26 UTC by Antoine Boulinguez
Modified: 2017-11-06 15:32 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 60507

Description Antoine Boulinguez 2017-11-06 14:26:14 UTC
Hi everyone,

I'm facing the following issue:

System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.LabelRenderer 

The context:

-Xamarin Forms PCL/Android project
-Master details page with a navigation page inside
-I navigate to a ContentPage
-I kill the app on my Android device (Nexus 5)
-The app crashes with the following exception stack:

MonoDroid(12709): UNHANDLED EXCEPTION:
MonoDroid(12709): System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.LabelRenderer from native handle 0xbeab6b1c (key_handle 0x12a7b64). ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Platform.Android.LabelRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
MonoDroid(12709):    --- End of inner exception stack trace ---
MonoDroid(12709):   at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00035] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:304 
MonoDroid(12709):   at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00111] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:282 
MonoDroid(12709):    --- End of inner exception stack trace ---
MonoDroid(12709):   at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00153] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:289 
MonoDroid(12709):   at Java.Lang.Object.GetObject (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type type) [0x000b9] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:467 
MonoDroid(12709):   at Java.Lang.Object._GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00017] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:438 
MonoDroid(12709):   at Java.Lang.Object.GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:430 
MonoDroid(12709):   at Java.Lang.Object.GetObject[T] (System.IntPtr jnienv, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00006] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:424 
MonoDroid(12709):   at Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/obj/Release/android-26/mcw/Android.Views.View.cs:13561 
MonoDroid(12709):   at (wrapper dynamic-method) System.Object:2c14a70f-59d8-4748-afd7-9121167cd4ca (intptr,intptr,intptr)
art     (12709): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
Mono    (12709): DllImport searching in: '__Internal' ('(null)').
Mono    (12709): Searching for 'java_interop_jnienv_throw'.
Mono    (12709): Probing 'java_interop_jnienv_throw'.
Mono    (12709): Found as 'java_interop_jnienv_throw'.
n occured.

MonoDroid(12709): UNHANDLED EXCEPTION:
MonoDroid(12709): System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.LabelRenderer from native handle 0xbeab6b1c (key_handle 0x12a7b64). ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Platform.Android.LabelRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
MonoDroid(12709):    --- End of inner exception stack trace ---
MonoDroid(12709):   at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00035] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:304 
MonoDroid(12709):   at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00111] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Interop/TypeManager.cs:282 
MonoDroid(12709):    --- End of inner exception stack trace ---
MonoDroid(12709):   at (wrapper managed-to-native) Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a (intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue*)
MonoDroid(12709):   at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00073] in <7cfbebb561c54efc9010b018c0846c7e>:0 
MonoDroid(12709):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <7cfbebb561c54efc9010b018c0846c7e>:0 
MonoDroid(12709):   at Android.Views.ViewGroup.RemoveAllViews () [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/obj/Release/android-26/mcw/Android.Views.ViewGroup.cs:3928 
MonoDroid(12709):   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:233 
MonoDroid(12709):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
MonoDroid(12709):   at Xamarin.Forms.Platform.Android.FastRenderers.FrameRenderer.Dispose (System.Boolean disposing) [0x0006d] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\FastRenderers\FrameRenderer.cs:126 
MonoDroid(12709):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
MonoDroid(12709):   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:229 
MonoDroid(12709):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
MonoDroid(12709):   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:289 
MonoDroid(12709):   at Xamarin.Forms.Platform.Android.ListViewRenderer.Dispose (System.Boolean disposing) [0x0001e] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ListViewRenderer.cs:53 
MonoDroid(12709):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
MonoDroid(12709):   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:229 
MonoDroid(12709):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
MonoDroid(12709):   at Xamarin.Forms.Platform.Android.ScrollViewContainer.Dispose (System.Boolean disposing) [0x00013] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewContainer.cs:49 
MonoDroid(12709):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
MonoDroid(12709):   at Xamarin.Forms.Platform.Android.ScrollViewRenderer.Dispose (System.Boolean disposing) [0x00029] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:177 
MonoDroid(12709):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
MonoDroid(12709):   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:229 
MonoDroid(12709):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
MonoDroid(12709):   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:229 
MonoDroid(12709):   at Xamarin.Forms.Platform.Android.PageRenderer.Dispose (System.Boolean disposing) [0x00011] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\Renderers\PageRenderer.cs:22 
MonoDroid(12709):   at Java.Lang.Object.Dispose () [0x00000] in /Users/builder/data/lanes/5147/c2a33d8e/source/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203 
MonoDroid(12709):   at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnDestroyView () [0x0003c] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:91 
MonoDroid(12709):   at Android.Support.V4.App.Fragment.n_OnDestroyView (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <40bb5a57295c4f648daa62e9e7aa774b>:0 
MonoDroid(12709):   at (wrapper dynamic-method) System.Object:4f38c576-edb5-47a7-8c32-96bf4f2a17d6 (intptr,intptr)


Installed nuget packages:

PCL:

Id                                  Versions      
--                                  --------      
CarouselView.FormsPlugin            {4.4.6}       
Com.OneSignal                       {3.0.1}       
Newtonsoft.Json                     {10.0.3}      
Xam.Plugin.Connectivity             {3.0.3}       
Xamarin.Forms                       {2.4.0.38779} 
Xamarin.Forms.Maps                  {2.4.0.38779} 

Android:

CarouselView.FormsPlugin            {4.4.6}      
Com.OneSignal                       {3.0.1}      
Xam.Plugin.Connectivity             {3.0.3}      
Xamarin.Android.Arch.Core.Common    {1.0.0}      
Xamarin.Android.Arch.Lifecycle.C... {1.0.1}      
Xamarin.Android.Arch.Lifecycle.R... {1.0.0}      
Xamarin.Android.Support.Animated... {26.1.0.1}   
Xamarin.Android.Support.Annotations {26.1.0.1}   
Xamarin.Android.Support.Compat      {26.1.0.1}   
Xamarin.Android.Support.Core.UI     {26.1.0.1}   
Xamarin.Android.Support.Core.Utils  {26.1.0.1}   
Xamarin.Android.Support.Design      {26.1.0.1}   
Xamarin.Android.Support.Fragment    {26.1.0.1}   
Xamarin.Android.Support.Media.Co... {26.1.0.1}   
Xamarin.Android.Support.Transition  {26.1.0.1}   
Xamarin.Android.Support.v4          {26.1.0.1}   
Xamarin.Android.Support.v7.AppCo... {26.1.0.1}   
Xamarin.Android.Support.v7.CardView {26.1.0.1}   
Xamarin.Android.Support.v7.Media... {26.1.0.1}   
Xamarin.Android.Support.v7.Palette  {26.1.0.1}   
Xamarin.Android.Support.v7.Recyc... {26.1.0.1}   
Xamarin.Android.Support.Vector.D... {26.1.0.1}   
Xamarin.Build.Download              {0.4.7}      
Xamarin.Forms                       {2.4.0.38779}
Xamarin.Forms.Maps                  {2.4.0.38779}
Xamarin.GooglePlayServices.Base     {42.1021.1}  
Xamarin.GooglePlayServices.Basement {42.1021.1}  
Xamarin.GooglePlayServices.Gcm      {42.1021.1}  
Xamarin.GooglePlayServices.Iid      {42.1021.1}  
Xamarin.GooglePlayServices.Location {42.1021.1}  
Xamarin.GooglePlayServices.Maps     {42.1021.1}  
Xamarin.GooglePlayServices.Tasks    {42.1021.1}  


I've not found any working solution on the Internet...

Thanks in advance for your help!
Comment 1 Paul DiPietro [MSFT] 2017-11-06 15:32:01 UTC

*** This bug has been marked as a duplicate of bug 60507 ***