Bug 39811 - Xamarin.GooglePlayServices.Maps 29.0.0.1 - Android.Gms.Maps.MapView JNI interop missing constructor
Summary: Xamarin.GooglePlayServices.Maps 29.0.0.1 - Android.Gms.Maps.MapView JNI inter...
Status: RESOLVED FIXED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jon Dick
URL:
Depends on:
Blocks:
 
Reported: 2016-03-21 15:19 UTC by Przemysław Raciborski
Modified: 2017-09-28 14:34 UTC (History)
2 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 FIXED

Description Przemysław Raciborski 2016-03-21 15:19:36 UTC
I use Xamarin.GooglePlayServices.Maps 29.0.0.1 - it looks like generated binding miss JNI interop constructor (IntPtr, JniHandleOwnership).

System.NotSupportedExceptionUnable to activate instance of type Android.Gms.Maps.MapView from native handle 0x25 (key_handle 0x2ce3cf2b).

  at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x001a4] in <filename unknown>:0 
  at Java.Lang.Object.GetObject (IntPtr handle, JniHandleOwnership transfer, System.Type type) [0x000e5] in <filename unknown>:0 
  at Java.Lang.Object._GetObject[T] (IntPtr handle, JniHandleOwnership transfer) [0x0001a] in <filename unknown>:0 
  at Java.Lang.Object.GetObject[T] (IntPtr handle, JniHandleOwnership transfer) [0x00000] in <filename unknown>:0 
  at Android.Views.LayoutInflater.CreateView (System.String name, System.String prefix, IAttributeSet attrs) [0x0008b] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Droid.Views.MvxLayoutInflater.CreateCustomViewInternal (Android.Views.View parent, Android.Views.View view, System.String name, Android.Content.Context viewContext, IAttributeSet attrs) [0x000bc] in <filename unknown>:0 
  at Cirrious.MvvmCross.Binding.Droid.Views.MvxLayoutInflater+PrivateFactoryWrapper2.OnCreateView (Android.Views.View parent, System.String name, Android.Content.Context context, IAttributeSet attrs) [0x0003d] in <filename unknown>:0 
  at Android.Views.LayoutInflater+IFactory2Invoker.n_OnCreateView_Landroid_view_View_Ljava_lang_String_Landroid_content_Context_Landroid_util_AttributeSet_ (IntPtr jnienv, IntPtr native__this, IntPtr native_parent, IntPtr native_name, IntPtr native_context, IntPtr native_attrs) [0x0002c] in <filename unknown>:0 
  at (wrapper dynamic-method) System.Object:5a5d1d20-0d65-4fbe-9759-603d2b1b741b (intptr,intptr,intptr,intptr,intptr,intptr)

System.MissingMethodExceptionNo constructor found for Android.Gms.Maps.MapView::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership)

  at Java.Interop.TypeManager.CreateProxy (System.Type type, IntPtr handle, JniHandleOwnership transfer) [0x00058] in <filename unknown>:0 
  at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x0012c] in <filename unknown>:0 


Please add this constructor inside Binding Addition class.

PS: I know we should avoid this constructor - but in this case it's MapView - it's "touched" by activity life-cycle so JNI constructor is "must be feature".
Comment 1 Jon Dick 2017-09-28 14:34:05 UTC
I believe this was fixed in 29.0.0.2 (and certainly newer versions).