Search code examples
androidapigoogle-mapsgoogle-maps-api-2android-maps

Android: Map not visible in app when adding API generated from keystore for release


I got my Google Map API key and embedded it in my code. At this moment MAP was working. No issues at this point.

Then, I generated signed apk and released the app on playstore. On downloading the app - map was not working (not showing any visuals) in any device.

Then to get Map API for release version (as I came to know later),

I did this:

  1. Generated signed apk using same keystore.
  2. Discovered my SHA1 certificate for that keystore. (Using this tutorial)
  3. Got new API from google Map APIs using this new SHA1 certificate and my package name.
  4. Embedded this new API into res > values > google_maps_api.xml file. Also, I added new API key in manifest.

Now, when I run the app, Map fragment is not showing any visuals. It looks pretty much like this:

enter image description here


Solution

  • try this,

    keytool -list -v -keystore "Your Keystore Path" -alias "Your alias name" -storepass "your keystore password" -keypass "your keystore password"