1

I have exception in xamarin forms – in android – when closing a custom map.

I am rendering it in android and once every 5~ times I get exception when closing the page with the google maps

The exception is as follows:

UNHANDLED EXCEPTION: System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Maps.Android.MapRenderer from native handle b250001d ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Maps.Android.MapRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown

I saw a post in stack overflow:

Error when navigating away from a page with a map on Android, while the on-screen keyboard is visible

and I tried to create a constructor like this:

public CustomMapRenderer(IntPtr javaReference, JniHandleOwnership jniHandleOwnership) : base(javaReference, jniHandleOwnership) { }

But I get compilation error:

'MapRenderer' does not contain a constructor that takes 2 arguments

What is this error ??

Community
  • 1
  • 1
asaf
  • 958
  • 1
  • 16
  • 38

0 Answers0