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,
- Login google developer console
- Select Library option from left side panel.
- Now you can see all API list and go to Google Maps APIs and select
Google Maps Android API . - 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
:
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
:
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:
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
- to create project at https://code.google.com/apis/console/
- to enable "Google Maps Android API v2"
- 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
Sqlite Query in Android to Count Rows
Clear Application Cache on Exit in Android
How to Launch the 'Add Contact' Activity in Android
"Unknown Bits Set in Runtime_Flags: 0X8000" Warning in Logcat on Android Q Emulator
Android UI Design: Supporting Multiple Screens
Is Arm64-V8A Compatible with Armeabi-V7A
Crop Video Before Encoding with Mediacodec for Grafika's "Continuous Capture" Activity
Auto Start Application After Boot Completed in Android
How to Calculate Azimuth, Pitch, Orientation When My Android Device Isn't Flat
Setting Audio File as Ringtone
How to Include a Library Module Dependency in an Android Studio Project
Setting Android Theme Background Color
Listview with Choice_Mode_Multiple Using Checkedtext in a Custom View
How to Force an Intentservice to Stop Immediately with a Cancel Button from an Activity