简体   繁体   中英

Android Google Maps API V2 not showing map when published

Just ran into a problem, when testing on device while in development - maps worked fine. After I published it to beta stage I downloaded it from Google Play Store and ran the app, but map showed up grey and didn't work.

What am I doing wrong?

my api key is specified in manifest like:

<meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="API_KEY_HERE" />

Okay, got it fixed. When I exported and signed the apk for publishing it gave me SHA1 and MD5 keys. I just copied SHA1 key and went to Google API's and edited allowed Android Devices.

There I added new line so the new Android Devices looked like: debug.key.sha1;package.app just.generated.sha1;package.app

didn't even need to reupload new APK, it just worked straight away.

Also this helped: http://smdaudhilbe.wordpress.com/tag/google-maps-v2-not-displaying-after-app-published-in-google-play/

密钥绑定到apk签名-我很确定这是您的问题

When you publish an app that uses Google Maps API and your map in the released version is blank or gray then do the following...

  1. find your keystore (*.jks file) (you needed to generate this in order to publish anyway)

  2. execute something like this in command prompt (Windows) "C:\\Program Files\\Java... whatever java version you have ...\\jre\\bin\\keytool.exe" -list -v -keystore myappkeystore.jks

You'll see a bunch of info including your release APK's SHA1 if done right.

  1. Go here: https://code.google.com/apis/console

  2. Opt out of the new interface (its horrible) and use the old interface if possible

  3. In old interface go to services and make sure Google Maps is enabled

  4. Now go to API Access and update your old SHA1 with the new one by click "Edit Allowed Android Apps" to the right and overwrite the old one with the new one. Click Update. Done.

When we deploy on Play Store, Google generates a new SHA1 hash for the version published. To solve this issue, it is necessary to open the application's console on the Play Store and take the new SHA1 in Version Management -> App Subscription. Finally, you can use this SHA1 in Google Maps API Console to generate your Maps key.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM