amay077 / Xamarin.Forms.GoogleMaps

Map library for Xamarin.Forms using Google maps API
https://www.nuget.org/packages/Xamarin.Forms.GoogleMaps/
MIT License
546 stars 346 forks source link

[UWP] Map is not showing in Release #698

Open marshallcoco opened 4 years ago

marshallcoco commented 4 years ago

VERSIONS

PLATFORMS

ACTUAL BEHAVIOR

I work on a Xamarin.Forms application targeting UWP, which uses Xamarin.Forms.GoogleMaps. In Debug, everything works fine but in Release the map doesn't show up (it's completely blank).

HOW TO REPRODUCE

I generated a Bing Map API key (MY_KEY in code below) with this properties:

In UWP project, App.Xaml.cs, OnLaunched method I put this code:

           var rendererAssemblies = new[]
            {
                typeof(Xamarin.Forms.GoogleMaps.UWP.MapRenderer).GetType().Assembly
            };

            Xamarin.FormsGoogleMaps.Init("MY_KEY");

            Xamarin.Forms.Forms.Init(e, rendererAssemblies);

And of course there is a view with a map in my application: xmlns:maps="clr-namespace:Xamarin.Forms.GoogleMaps;assembly=Xamarin.Forms.GoogleMaps"

As mentioned above, this works fine in Debug mode (map is displayed, centered on Rome) but in Release the map is blank.

Thanks!

ypcaptain96 commented 3 years ago

Any updates on this issue? This issue is still present.

symbiogenesis commented 2 years ago

Looks like if you are compiling with the .NET Native toolchain you need to set the rendererAssemblies in App.xaml.cs to point to the UWP renderer, and not the portable renderer