1

Android Studio 3.1.3
Android 6.0
Gradle 4.4

I want to get new Google map api key. So here my steps:

  1. In my android project in Android Studio I open file: "googel_maps_api.xml"

  2. Copy to clipboard the next url:

    https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=90:32:34:28:BE:CC:5D:04:E3:99:43:xx:97:xxx30:42:82:3A:66:CF%3Bcom.myprojectcustomer.debug

  3. In google console I select my project and click button

enter image description here

  1. Click button to create new key api enter image description here

here result enter image description here

  1. copy generated key in file "googel_maps_api.xml" in field google_maps_key

  2. In manifest file add meta data android:name="com.google.android.geo.API_KEY" :

  3. Here google api that I use:

enter image description here

  1. Restart my android app

  2. But on logcat I get error:

        E/Google Maps Android API( 9757): 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( 9757): In the Google Developer Console (https://console.developers.google.com)
        E/Google Maps Android API( 9757): Ensure that the "Google Maps Android API v2" is enabled.
        E/Google Maps Android API( 9757): Ensure that the following Android Key exists:
        E/Google Maps Android API( 9757):   API Key: AIzaSyCTvKejzCdZxxxxxxxxxxSIPG9DkegNss4-VJ8fjVt4
        E/Google Maps Android API( 9757):   Android Application (<cert_fingerprint>;<package_name>): B7:CE:53:19:C4:xx:Bxx2C:C6:51:35:AD:32:47:1E:53:6B:1A:0D:B9;com.myprojectcustomer.debug
    

And as result the map is not show.

Alexei
  • 14,350
  • 37
  • 121
  • 240

1 Answers1

3

Check to make sure you have Maps SDK for Android enabled for the specific project in your Google API console. Also check the "Application Restrictions" for that particular key in your Google API Console. If you have "Android apps" selected, the package name and the SHA-1 fingerprint must match the package name of your Android project and the SHA-1 fingerprint generated in your google_maps_api.xml file. You can also select "None" in the "Application Restrictions" and all you need to do is place the correct API Key in your google_maps_api.xml file.

J. Jefferson
  • 980
  • 8
  • 12
  • SHA-1 certificate fingerprint (in Google console): 90:32:34:28:BE:CC:5D:04:E3:99:43:76:97:F5:30:42:82:3A:66:CF but in logcat error with another fingerprint E/Google Maps Android API(27622): Android Application (;): B7:CE:53:19:C4:B4:B0:2C:C6:51:35:AD:32:47:1E:53:6B:1A:0D:B9;com.myproject.android.customer.debug – Alexei Jun 26 '18 at 15:50
  • 1
    Try copying the SHA-1 fringerprint in the logcat, B7:CE:53:19:C4:B4:B0:2C:C6:51:35:AD:32:47:1E:53:6B:1A:0D:B9, and pasting it in the Google Console "SHA-1 certificate fingerprint" field. Also copy and paste the package name, com.myproject.android.customer.debug, into the "Package name" field for good measure. – J. Jefferson Jun 26 '18 at 16:07
  • Yes, it's help. Thanks. – Alexei Jun 26 '18 at 16:12