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 gen
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.
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.
The API key needs to be hardcoded into the Android Manifest, and it doesn't work if it's in a separate resources XML file.
for futures refs ---my case--- there are two google_maps_api.xml files where you need to put your google api key. You can very easily do the mistake to replace YOUR_API_KEY in only one of them (especially if you just deleted the google api/app and created new ones)
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:
E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: AIzaS<YOUR KEY YOUR KEY YOUR KEY YOUR KEY>
Android Application (<cert_fingerprint>;<package_name>): 56:AF:B2:<THIS IS WHAT YOU ARE LOOKING FOR>;br.com.tinx.<your package>
then, just follow those instructions, creating a new entry in the Developer Console.
There are two things to remember and get this working.
Debug Build Variant
Release Build Variant
In the AndroidManifest.xml add the following line :
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
Follow the normal procedure for debug and release. It should work seamlessly.