Xamarin.Forms.Maps repeated authentication error

Hi all,
I am having some trouble integrating google maps with the Xamarin maps SDK, I have already contacted google on the matter but they said they can only help if it is part of the google maps SDK itself. The reason why I am using Xamarin.Maps over the google play service maps are because I am building this application to work cross-platform and I doubt that the google play services maps will work on both iOS and Android (Not building for Windows Phones).

The problem I am having is that I am getting the same authentication error every single time causing the maps to not display any of the data itself. I followed the guide on Xamarin.Forms Map Initialization but still have nothing.
I have checked the API key many times and even created new ones just encase I did the setup wrong on the google console end. As well as this I have also checked all my authentication information to the same degree, I am certain the data I have entered isn't wrong. Can anyone provide any insight to if I have entered the data in the wrong manner or if there is simply something deeper going on here!
~Thanks - Alex

Right now I am debugging on android so I just want to get it working there first

The Error (API key removed):
11-07 16:18:31.173 E/Google Maps Android API( 6862): Authorization failure. Please see developers.google/maps/documentation/android-api/start for how to correctly set up the map.
11-07 16:18:31.176 E/Google Maps Android API( 6862): In the Google Developer Console (console.developers.google)
11-07 16:18:31.176 E/Google Maps Android API( 6862): Ensure that the "Google Maps Android API v2" is enabled.
11-07 16:18:31.176 E/Google Maps Android API( 6862): Ensure that the following Android Key exists:
11-07 16:18:31.176 E/Google Maps Android API( 6862): API Key: AIzaSyBpwq(The full API key is here just censored for the forums)
11-07 16:18:31.176 E/Google Maps Android API( 6862): Android Application (;): 42:DF:8F:89:DE:8A:48:25:34:(Full cert is here but censored for forms);com.IFDS.carapp

Posts

  • JoeMankeJoeManke USMember ✭✭✭✭✭

    On the Google Developer Console, do you have any restrictions set on your key? This is what my page looks like:

    And how are you adding the key in your Android project?

  • AlexWilliams.4669AlexWilliams.4669 USMember ✭✭

    @JoeManke said:
    On the Google Developer Console, do you have any restrictions set on your key? This is what my page looks like:

    And how are you adding the key in your Android project?

    My Console page looks exactly the same as yours with the obvious exception of different credentials on Restricted usage.
    The api key is implemented through the Android manifest file, the code is here:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.IFDS.carapp" android:installLocation="auto">
      <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
      <application android:label="carApp.Android">
        
        <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyBpwq" />
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
        <uses-library android:name="org.apache.http.legacy" android:required="false" />
      </application>
      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
      <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
      <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    </manifest>
    

    Here are also all the SDK versions I am using:

    NetStandard.Libary: 2.0.3
    Xamarin.Android.Support.Core.Utils: 28.0.0.3
    Xamarin.Essentials: 1.3.1
    Xamarin.Forms: 4.3.0.947036
    Xamarin.Forms.Maps: 4.3.0.947036

  • JoeMankeJoeManke USMember ✭✭✭✭✭

    I have "com.google.android.geo.API_KEY" rather than "com.google.android.maps.v2.API_KEY" in my manifest.

  • AlexWilliams.4669AlexWilliams.4669 USMember ✭✭

    @JoeManke said:
    I have "com.google.android.geo.API_KEY" rather than "com.google.android.maps.v2.API_KEY" in my manifest.

    Yeah I have tried both but neither of them work :/ (I actually had it hashed out but it doesn't display in code snips IDk why). It is consistently the same error for both! I am very stumped on this.

Sign In or Register to comment.