Android Sha1 Release Keystore Not Working with Google Maps

Android SHA1 release keystore not working with Google Maps

You have two google_maps_api.xml files

One in this folder:

app/src/debug/res/values

Other in this folder:

app/src/release/res/values

But only the debug one contains your API key probably.

Google maps not show in release mode android

Add the apikey to debug>res>values>google_maps_api.xml
then add release>res>values>google_maps_api.xml.

Then check it work or not.

Maybe you have 2 google_maps_api.xml files, one in the app/src/debug/res/values folder and the other in the app/src/release/res/values folder, but only the debug one contains your API key.

SHA1 for google map release key is showing some encrypted text

You can use the keytool -list -v command (documentation):

keytool -list -v -alias razon** -keystore E:\keystore\keystore.jks

How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?

Easiest ways ever:

Update added for Android Studio V 2.2 in last step

There are two ways to do this.

1. Faster way:

  1. Open Android Studio
  2. Open your Project
  3. Click on Gradle (From Right Side Panel, you will see Gradle Bar)
  4. Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project)
  5. Click on Your Project (Your Project Name form List (root))
  6. Click on Tasks
  7. Click on Android
  8. Double Click on signingReport (You will get SHA1 and MD5 in Run Bar(Sometimes it will be in Gradle Console))
  9. Select app module from module selection dropdown to run or debug your application

Check the screenshot below:

Sample Image

2. Work with Google Maps Activity:

  1. Open Android Studio
  2. Open Your Project
  3. Click on File menu -> Select New -> Click on Google -> Select Google Maps Activity
  4. A dialog would appear -> Click on Finish
  5. Android Studio would automatically generate an XML file named with google_maps_api.xml
  6. You would get debug SHA1 key here (at line number 10 of the XML file)

Check Screenshot below:

Sample Image

Android Studio V 2.2 Update

There is an issue with Execution.

Solution:

  • Click on Toggle tasks execution/text mode from Run bar

Check Screenshot below:

Sample Image

Done.

Google Maps not working in derived apk (published app)

Ok, I just solved it (after making this post 13 minutes ago).

So after implementing this solution

Android Studio - Google map still blank on real Android device

I noticed that this error in my Android Monitor when running the apk from my phone:

Android Application (<cert_fingerprint>;<package_name>): <what I assume is a SHA1 fingerprint>;<my_package_name>

So I just copied the SHA1 fingerprint, added it to the API credential restrictions and saved it. And after a few minutes, ran the app again, and it worked.

No need to reupload/update apk.

Hope this helped anyone else.



Related Topics



Leave a reply



Submit