xamarin android Google maps exception when closing page with map

拈花ヽ惹草 提交于 2019-12-11 04:59:10

问题


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 ??

来源:https://stackoverflow.com/questions/38403650/xamarin-android-google-maps-exception-when-closing-page-with-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!