Google Maps are not showing up in a signed apk Google Maps are not showing up in a signed apk android android

Google Maps are not showing up in a signed apk


It sounds like you only have the API key entered in the debug google_maps_api.xml. Also, it sounds like you're using the same API key for debug and release, but you still need to enter it in the google_maps_api.xml under the release folder as well as the one in the debug folder.

It's a little confusing, because when the project is in Android view, you can only see the debug file (although it should have (debug) in parenthesis next to it in that view).

In order to modify the release version, switch to Project view by using the dropdown in the upper left of the Project Explorer. Then, expand app/src/, and you will see subfolders debug and release. Under there, you should see two separate google_maps_api.xml files under debug/res/values and release/res/values.

Make sure that the API key is populated in the google_maps_api.xml file under the release/res/values folder, since this is the one that will be used for the signed release apk.

enter image description here


If you chose Google Play App Signing then your App's SHA-1 will be different one when it will be released.

Because Google remove your uploaded certificate and then sign the App with a new one,

So you have to know the new SHA-1 key.

(You don't have to follow the log for release and track the new SHA-1 generated)

enter image description here


You can compare the 2 SHA-1 keys.

Origin answer


I did a lot of things to fix these but any solution not fix my problem to fix these issue I did these things

  1. Create signed apk with new keystore file make sure that the you will create that in release mode
  2. After creating the signed apk you should note the keystore path where you save your keystore file.
  3. You also need to use your google map API key with your release mode and debug mode both, you can use same API key with both but make sure that you should add two different sha keys for your single api key on google console.
  4. You should go to use the path of bin folder of java from c drive because keystore tool is inside bin folder so suppose your file is like C:\Program Files\Java\jdk1.8.0_11\binso you should follow this path to your android studio terminal change the path to C:\Program Files\Java\jdk1.8.0_11\binand then type this command:

    keytool -list -v -keystore "/Users/NT/Desktop/generalkey.jks"(adress of your keystore file)
  5. Now by doing these you will get the sha key copy that key

  6. Go to google console/credentials
  7. Now go to your api you will see edit option go to edit and past your sha key into it and save it .
  8. Run your code.