Ensure That the "Google Maps Android API V2" Is Enabled. I am Getting This Error When I Try to Implement Google Maps

Ensure that the Google Maps Android API v2 is enabled. I am getting this error when I try to Implement Google Maps

From error it is clear that You did not enable google map api for android. To enable,

  1. Login google developer console
  2. Select Library option from left side panel.
  3. Now you can see all API list and go to Google Maps APIs and select
    Google Maps Android API .
  4. Now you can see option to enable/disable API. Enable it.

I hope it help you.

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

I followed this tutorial and I was able to fix it: https://www.youtube.com/watch?v=sJBlQv6IptQ. The video makes references to this tutorial: http://ramsandroid4all.blogspot.com/2016/01/google-maps-android-example-in-android.html.

In my case, what I did was to create a new project at https://console.developers.google.com/. I used Android apps for Application restrictions:

Sample Image

For the Restrict usage to your Android apps section, I had to provide a Package name and a SHA-1 certificate fingerprint. The Package name was in my app/build.gradle, specifically here:

applicationId "[my package name]"

The SHA-1 certificate fingerprint I found it from Android Studio by running signingReport:

Sample Image

The result included something like this:

Alias: AndroidDebugKey
MD5: [The value]
SHA1: [The value]
SHA-256: [The value]
Valid until: Wednesday, May 5, 2049
----------

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
16:31:44: Task execution finished 'signingReport'.

Now the map works correctly in my Android app:

Sample Image

UPDATE 1: To my surprise, the maps were working correctly only on the Android Studio Emulator but not on real Android physical devices. The solution was what I posted at https://stackoverflow.com/a/56307654/4242086.

Google Maps Android API v2 Authorization failure

Steps:

  • to ensure that device has Google Play services APK
  • to install Google Play Service rev. more than 2

Sample Image

  • to create project at https://code.google.com/apis/console/
  • to enable "Google Maps Android API v2"
    Sample Image
  • to register of SHA1 in project (NOW, YOU NEED WRITE SHA1;your.app.package.name) at APIs console and get API KEY
  • to copy directory ANDROID_SDK_DIR/extras/google/google_play_services/libproject/google-play-services_lib to root of your project
  • to add next line to the YOUR_PROJECT/project.properties

android.library.reference.1=google-play-services_lib

  • to add next lines to the YOUR_PROJECT/proguard-project.txt

.

-keep class * extends java.util.ListResourceBundle {

protected Object[][] getContents();

}

Now you are ready to create your own Google Map app with using Google Map APIs V2 for Android.

If you create application with min SDK = 8, please use android support library v4 + SupportMapFragment instead of MapFragment.

Google maps v2: Authorization failure

Activate the Google Maps Android API v2 service in the Google API's console. Also, after making changes do a full reinstall of the app on the device/emulator.

Authorization failure with Google Maps Android API

The problem was located in local.properties:
Instead of MAPS_API_KEY="AbCdEfGhi1234..." it should read MAPS_API_KEY=AbCdEfGhi1234...

Don't surround the key with ""...



Related Topics



Leave a reply



Submit