NAXAM / mapbox-xamarin-forms

Mapbox on Xamarin.Forms
Apache License 2.0
73 stars 41 forks source link

Unable to activate instance of type Naxam.Controls.Mapbox.Platform.Droid.MapViewRenderer from native handle #97

Open DynamicDave opened 4 years ago

DynamicDave commented 4 years ago

Dear Vũ Đức Tuyến,

I have a weird bug in my application. I'm using a Xamarin.Forms Shell app and whenever I repeatedly switch (click really fast) between Tabbar buttons to a page with a map, the application crashes with the error message "System.NotSupportedException: 'Unable to activate instance of type Naxam.Controls.Mapbox.Platform.Droid.MapViewRenderer from native handle 0xffd5887c (key_handle 0x2bc6e79).'".

The way to replicate this, is by taking your own Demo app and change the following:

App.xaml.cs: MainPage = new AppShell();

AppShell.xaml: <?xml version="1.0" encoding="UTF-8" ?> <Shell x:Class="MapBoxQs.AppShell" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:views="clr-namespace:MapBoxQs.Views"> <TabBar> <Tab Title="HomePage1"> <ShellContent ContentTemplate="{DataTemplate views:HomePage}" /> </Tab> <Tab Title="Get Started"> <ShellContent ContentTemplate="{DataTemplate views:GetStartedPage}" /> </Tab> </TabBar> </Shell>

Start the app and click really fast between the two buttons. This happens in debug and release mode on emulator and real devices.

Do you have an idea how to fix this?

Kind regards, Dave Jonker

DynamicDave commented 4 years ago

Nobody? :-(

lubiepomaranczki commented 2 years ago

Hey, coming late to the party buy did you manage to fix this or get around this? I am facing similar issue... 🙈