Why does Xamarin Forms Maps crash in UWP App?

1

I'm having a hard time trying to show a map on my Xamarin Forms UWP app. This is the error I get every time I open the page with the map:

The exception:

Exception   {System.Runtime.InteropServices.COMException (0x80004005):
Error HRESULT E_FAIL has been returned from a call to a COM component.}
System.Exception {System.Runtime.InteropServices.COMException}

Error code: -2147467259

Message: "Error HRESULT E_FAIL has been returned from a call to a COM component." string

enter image description here

In the file MainPage.cs the project UWP I have the next code:

In the MainPage.cs file of the UWP project I have the following code:

Xamarin.FormsMaps.Init ("API KEY");
LoadApplication(new Shopm.App());

The API key is Bing Maps. The API key that I created is with Type of key: Basic / Other public mobile application. It is right?

Only three options appear for creating an API KEY.

enter image description here

I followed the steps of the Xamarin.Forms page.

In Android its works but in UWP when clicking on a button for maps breaks my app.

c#
.net
xamarin.forms
asked on Stack Overflow Jun 23, 2018 by (unknown user) • edited Feb 12, 2019 by Stemado

1 Answer

1

For UWP the correct selection is that:

Application type: Select Universal Windows App for use in your Universal Windows app..

This is an example of what the form looks like. Bing Maps key

Follow the steps on this Documentation: https://docs.microsoft.com/en-us/windows/uwp/maps-and-location/authentication-key

answered on Stack Overflow Jun 23, 2018 by Tony • edited Jun 23, 2018 by Tony

User contributions licensed under CC BY-SA 3.0