Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - Google map still blank on real Android device on release apk

googled it, read millions of advices about how to generate google API key, how to use it but nothing works!

  1. enabled google maps v2 API
  2. created project with one activity with google map (default wizard in studio)
  3. created key on google for debug project, assigned SHA1;app package of application to the project key on google
  4. API key inserted into google_maps_api.xml (AndroidManifest.xml updated automaticaly)
  5. build & run on AVD on which the app is working, map is shown.

Then:

  1. API already enabled
  2. in Android studio created keystore for release (keystore.rel.jks)
  3. generated fingerprints (keytool -list -v -keystore C:\Dropbox\AndroidKeyStore\keystore.rel.jks)
  4. on google added new fingerprint to the new release project (release SHA1;app package) - key generated AIza...
  5. API key inserted into google_maps_api.xml (AndroidManifest.xml updated automatically)
  6. 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

like image 854
morganzd Avatar asked May 31 '15 16:05

morganzd


People also ask

Why is my Google Maps app blank?

This problem generally happens when you have too many bugged cookies in your browser or cached data in your Android app. The best solution to blank Google Maps is getting rid of the unwanted data from your mobile app or web browser.

Why is Google Maps not working on my Android phone?

You may need to update your Google Maps app, connect to a stronger Wi-Fi signal, recalibrate the app, or check your location services. You can also reinstall the Google Maps app if it isn't working, or simply restart your iPhone or Android phone. Visit Business Insider's homepage for more stories.


2 Answers

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.

enter image description here

like image 169
Daniel Nugent Avatar answered Sep 28 '22 21:09

Daniel Nugent


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.

like image 44
Andres Felipe Avatar answered Sep 28 '22 20:09

Andres Felipe