Make sure "Google Maps Android API v2" is enabled. I get this error when I try to execute Google Maps

I am working on google maps and I am getting this error. I have done the following:

  • Got the imprint of my sha1.

  • I registered my project and received my project key.

I don’t know how to get Google Maps Android API v2 to turn on, because all the links I tried are old, and Google changed its site design. Please help me. I have already spent a lot of time on this.

My logarithm is:

enter image description here

Authorization failure. Please see 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 (console.developers.google.com) Ensure that the "Google Maps Android API v2" is enabled. Ensure that the following Android Key exists: API Key: AIzaSyBK8rKr9lCRLhzv68I4Q26G9pHHO****** 
+21
source share
7 answers

Due to the error, it is clear that you did not enable google map api for android. To turn on,

  • Sign in to the Google Developer Console.
  • Select the Library option in the left pane.
  • Now you can view a list of all the APIs and go to the Google Maps API and select the Google Maps API for Android.
  • Now you can see how to enable / disable the API. Turn it on.

Hope this helps you.

+32
source

Actually, I had the same problem. my application is working, but the card is empty!

I actually had a problem in the limitations of the API Key


Google Developer Console

  1. Log in to the developer console.
  2. In your toolbar navigation menu (left)
  3. Select APIs and Services> Credentials.
  4. Thus, you will be redirected to the credentials page, where you can view all the API keys you created ( https://console.cloud.google.com/apis/credentials ).
  5. Define your project API key and click " Change API Key ".
  6. Under this you can see the key limitations
  7. From there, they remove all the limitations of applications and Api.

On your Android Mobile

  1. Uninstall the application.

Android Studio

  1. Build> Clean project.
  2. Build> Rebild Project.
  3. Run it

These steps worked fine for me.

+13
source

I had the same problem, but in the following setup:

My real development took place on a Windows machine. Then I bought a Mac and decided that I would develop it. I installed Android Studio on my Mac, extracted my project from Github, and then tried to launch it using my Android phone. Installing the APK completed without any problems. However, after launching the application on the phone, GoogleMap will not be displayed, even if the rest of my application will work fine. Then I found this link => https://github.com/react-community/react-native-maps/issues/69 , went to my console.developers.google.com/ and opened my Google Maps key, in which it appeared problem. from.

I saw that the key was limited to Android apps. But I was working on an Android app, how could this be a problem? Somehow, I switched Key Restriction to None , restarted my application, and GoogleMap loaded as it should.

+7
source

This can happen if the package name is incorrect in the console credentials section for development and production. Make sure your package name is spelled correctly. In my case, the package name was wrong, when I fixed it, the map became visible

+1
source

you may need to add new SHA-1 certificate fingerprints to the API key application restriction page: enter image description here

to create SHA1 certificate fingerprints for your debug build, use keytool from java jre as the following command:

 C:\Program Files\Android\Android Studio\jre\bin>keytool -list -v -keystore C:\Users\linhd\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android 
+1
source

An error appears in Android Error.

In your error Error showing it to check the first google v2 map API is enabled in the Google developer console.

just open the Google developer console, and you just need to use this API, and some settings need to be done there to access the map.

You can see the process and more details from here.

Working with Google V2 Map

0
source

I added a key from another test project to the main one. Then I opened https://console.developers.google.com/ and added this key with a new application name (as Lin Tao wrote), but that did not help.

Then I added a new type of activity (the "Activity on Google Maps" template in the gallery) and opened the google_maps_api.xml file. From there, I again found a link, for example https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=06:F2:F4:CD...applicationName .

I opened app/build.gradle , found the value of applicationId using applicationIdSuffix , if it exists, and connected, for example, in com.example.myapp.debug . In the link, I changed applicationName to this new value and opened the link.

Again created a new project, generated a new key and edited it, wrote the package name and SHA-1 fingerprint, as @Linh Dao wrote. Then saved. If you later find this key, find your project in the Google console and open the credentials.

I deleted the unnecessary activity card and saved it in AndroidManifest

 <meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/google_maps_key" /> 

in the application tag.

UPDATE

A few months later I got the same exception in the debug assembly. As I understand it, I installed the wrong API key.

In LogCat, I saw this exception:

enter image description here

Then I opened https://console.developers.google.com/ , the project was opened and clicked "SDK Cards for Android".

enter image description here

Go to the Credentials tab (you can also see https://developers.google.com/maps/documentation/android-sdk/signup for information). Click your API key.

enter image description here

On the API key page, under β€œ Key restrictions set Application restrictions . Click + Add package name and fingerprint .

Enter the name of your package from LogCat above (e.g. com.your_package.debug). Enter your fingerprint from LogCat (91: D6: ...: F7). Save it.

As @ Ahamed Rasheed wrote, I invalidated the caches, cleaned and rebuilt the project.

0
source

All Articles