I have developed an android application which has a map fragment in it. I got the "map key" from "google developer console" by specifying my project's package name and other required details.
I generally test my application by connecting an actual device to my machine and everything works ok. But when i build an apk as a debug or release version and install the apk in the same/different device, it doesn't show the map at-all.
I use Android Studio for development and build process.
How do i fix this issue? I am definitely sure that its something to do with the key not being picked properly when i build the apk but i am not sure how to fix this issue!
Update 1:
I figured out the problem using all of your suggestion. The part which i missing was that i was generating a new keystore in Android studio using "Generate signed apk" so that my apk is signed with the new SHA-1 for the release but i was not telling google that it needs to consider my new SHA-1.
So i did the following
- I went on the terminal/command prompt, got the newly created SHA-1. I used the command "keytool -list -keystore my_key_store_name.jks -alias my_key_store_alias_name" . This displayed my SHA-1
- I copied the SHA-1 and went to google developer console and added the project's package name and the new SHA-1
After the above steps, my map is displayed properly. :)
Thanks everyone for helping me solve it.