My google map app works fine on device with debug google map API KEY but when I create signed apk for my app with release google map API KEY, it does not display map. To generate release mode google API KEY , i am using SHA1 fingerprint with my keystore. And i am also defining "signing and build types" in my project Settings as explained by developer.android.com(http://developer.android.com/tools/publishing/app-signing.html).
Tried every possible solution(removing apk and than reinstalling it again, restarting the device, cleaning the project ). nothing worked. Anybody have a good solution to my problem please help. FYI Using android studios platform.
check Google's documentation
How do I get the release api SHA1 fingerprint:
install your signed APK, from Playstore, or just copying it to the phone.
Plug USB cable if it is a real phone, and open Android Studio.
The first time you try to get maps, a Log entry will show something like:
then, just follow those instructions, creating a new entry in the Developer Console.
Maybe you have two 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.
Debug certificate is different from your production certificate. You need to add both to your Google Maps key entry in your API console as seaparate row - each with the same packageId, but naturally different SHA1 hash.
EDIT
There's no limit of how many certificate fingerprints and package names are assigned to single Google Maps key, so unless you need this separated is's perfectly fine to have both development and production builds using the same key. In google console it would be like this (one sha1 is from debug cert, which is the same for all apps you build using this IDE, other is production cert):
or even (but I do not recommend using same key for different apps):
Sorry for replying late. Hope this helps for future. I use this solution to solve same problem When we are using Google maps while developing, a default debug.keystore is used which has no password. When we build apk file to upload on Play store new SHA-1 key is made so we have to make new debug.keystore for that. We have to create new API key for that SHA-1. According to solution How to obtain Signing certificate fingerprint (SHA1) for OAuth 2.0 on Android? we can get SHA-1 for the exported apk file .
After that use that new API key in Android Manifest as the previous one and you are done.
EDIT 1-
Steps to do this
1) Create apk file using "Use the export Wizard" in "Android Manifest" file of your project.
2) After inserting key and before finishing, MD5 and SHA1 keys are shown as shown is this given pic- (http://i.stack.imgur.com/SldEv.png)
3) Create new API Key for Android project in https://console.developers.google.com for new SHA1 which is retrieved in point 2).
4)Use that API key in manifest file as shown below
5)Clean your project and build APK file again as per point 1).
6) You can see google maps now in that apk.
There are two things to remember and get this working.
Debug Build Variant
Release Build Variant
In the AndroidManifest.xml add the following line :
Follow the normal procedure for debug and release. It should work seamlessly.