googled it, read millions of advices about how to generate google API key, how to use it but nothing works!
- enabled google maps v2 API
- created project with one activity with google map (default wizard in studio)
- created key on google for debug project, assigned SHA1;app package of application to the project key on google
- API key inserted into google_maps_api.xml (AndroidManifest.xml updated automaticaly)
- build & run on AVD on which the app is working, map is shown.
Then:
- API already enabled
- in Android studio created keystore for release (keystore.rel.jks)
- generated fingerprints (keytool -list -v -keystore C:\\Dropbox\\AndroidKeyStore\\keystore.rel.jks)
- on google added new fingerprint to the new release project (release SHA1;app package) - key generated AIza...
- API key inserted into google_maps_api.xml (AndroidManifest.xml updated automatically)
- generate signed app (using keystore.rel.jks) & install on real device ... app is working, map is STILL BLANK, only zoom buttons and Google label is on
Thanks in advance for any advice.
Zdenek
Make sure you enter your release API key in the google_maps_api.xml under the release folder.
First, 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 release API key is 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.
i was tired of trying over and over again, it turns out that PlayStore has something called App signing certificate, and the map works after i copy that sha1 and paste it in the google console for the android map.
Make sure the map key you entered in google_maps_api.xml file is the same android key, generated by google console.
You can also try a new key.
I faced the same problem, in my case fingerprint of my package used in google map API key was mismatched so what i did:
And execute the application
Do not use below fingerprint, or key, create your separate it is based on package ans application
When you try to create map api key please make sure the url contain correct package name. It should not take any sub package like this.
wrong package :com.gpslocation.trackerpro.Activities
correct package :com.gpslocation.trackerpro
After editing don\'t forget to save
Got stuck on this issue for a day. I tried everything and eventually found the following code in my manifest:
<supports-screens
android:anyDensity=\"false\"
android:largeScreens=\"true\"
android:normalScreens=\"true\"
android:smallScreens=\"false\"
android:xlargeScreens=\"true\" />
After removing these lines my maps displayed correctly.