Google Maps API key in release not working

I am currently developing an application for Android and I am using the Google Maps API. In the developer console, I added my SHA1 certificate certificate, and then my package name. Although I printed this SHA1 certificate with keytool, I can’t access the cards. I did a lot of searching, but all the topics led me to answers where the error was in the wrong API key in the developer console. But I took the correct SHA1, one of my certificates.

Thanks in advance!

+5
source share
4 answers

I had the same problem, it was very difficult. What I ended up doing is taking the key that I made using my keystore and putting it in the Google Developer Console. Then the following was added to the android manifest.

<meta-data android:name="com.google.android.geo.API_KEY" android:value="KEY GOES HERE"/> 

I am sure that you have read the documentation on this subject, but be sure to follow the instructions for the certificate of issue per point.

https://developers.google.com/maps/documentation/android/signup

You can also follow the link created for you in google_maps_api.xml. This automates the process of entering a key into the developer console. However, make sure that you add this metadata to your manifest.

+6
source

The google_maps_api.xml file must be under res / debug / and res / release. The editor shows only the current launch configuration, which is debugged by default and a little misleading if you did not notice a note (debug) after the folder name. Copy the google_maps_api.xml file into both folders and edit, make sure that they have the correct API keys for each assembly.

+3
source

My card showed up in release mode, but it didn’t show up after being published on the Play Store.

I mentioned both the debug certificate and the SHA-1 Key release for the Google Developer Console, but it still didn’t show up in the release mode after downloading the application from the play store.

Here was the problem: Google Play App signing is enabled for this app.

Go to release management β†’ Sign a subscription β†’ and copy the SHA-1 certificate thumbprint certificate from the certificate signing certificate

Paste this new copied SHA-1 fingerprint into the developer console and display the card in release mode.

+3
source

Android Studio also creates a TODO in the release folder for the google_maps_api XML file and lets you know the required procedure before release. Also do not change the key in the manifest manually. When you switch to the release option, the key is automatically updated in the manifest.

Anyway,

  • Follow the link mentioned by @Andrew Brook

  • Click Get Key and continue.

  • Either create a new project, or use an existing one.
  • Specify options and click
  • If you've already done this before, for let say for debug, then go to Create new api key Image here
  • Add the name you want, click "Add package name and fingerprint"
  • Add the application package name and SHA-1 key (generator using keytool in java / jdk ../ bin /) Image here
  • You get the API key for the release option, which should be added to the google_maps_api xml file in the release folder.
0
source

All Articles