Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps Android API: Authorization failure. Ensure that the "Google Maps Android API v2" is enabled. Ensure that the following Android Key exists

I am getting this error:

E/Google Maps Android API: Authorization failure.  Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
    API Key: [The key...]
    Android Application (<cert_fingerprint>;<package_name>):

Instead of the map working correctly, this is what I see:

enter image description here

In my app/build.gradle, I have this:

implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.android.gms:play-services-awareness:16.0.0'
implementation 'com.google.android.gms:play-services-cast:16.2.0'
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'

play-services-location is what I need for the Google Maps, correct? I was looking at the list at https://developers.google.com/android/guides/setup and I assume that Google Location and Activity Recognition - com.google.android.gms:play-services-location:16.0.0 is what I need for Google Maps. Is this correct?

UPDATE 1: I already have Maps SDK for Android enabled:

enter image description here

The error says: Ensure that the "Google Maps Android API v2" is enabled.. Is it referring to the Maps SDK for Android that I am showing in the screenshot in this UPDATE 1?

UPDATE 2: I have Maps SDK for Android enabled:

enter image description here

When I click the MANAGE button, I can go to the section to configure credentials that I showed in UPDATE 1.

UPDATE 3: I see the Map displayed correctly on all versions of Android on the Emulator. But on physical devices, the map never shows up. I see the Google logo and the red balloon, but now the map when I run the app on physical phones. Only on the Emulator everything works. Any ideas why?

UPDATE 4: See my solution at https://stackoverflow.com/a/56307654/4242086.

like image 381
Jaime Montoya Avatar asked May 23 '19 21:05

Jaime Montoya


People also ask

How do I ensure Google Maps Android API v2 is enabled?

Enter the project name and id of your choice. Click on the “APIs & auth” menu on the left, and from the submenu select APIs. From the list of APIs that appear, scroll down and ensure that Google Maps Android API v2 is set to “On”.


1 Answers

Hey I had the same problem today!,I solved it very easy for first you have to go https://console.developers.google.com and enable the android SDK maps and then create the api key, return in xamarin go to your manifest and add the google maps api key

https://docs.microsoft.com/it-it/xamarin/android/platform/maps-and-location/maps/obtaining-a-google-maps-api-key?tabs=windows

This is the documentation (I typed this fast because am on mobile now sorry)

like image 147
R4y Avatar answered Sep 17 '22 18:09

R4y