Maps Activity Blank after uploaded to Play Store [duplicate]

情到浓时终转凉″ 提交于 2019-12-06 10:42:05

问题


As mentioned in the title, the Maps Activity shows blank (with Google logo underneath) after I've uploaded the application. I am aware this question has been asked many times but none of the solution is able to resolve my issue.

This is what I've done so far:

  • Generated Google Maps Release API Key (with SHA-1 signature) following the official guide here and placed it under the release/res/values/google_maps_api.xml
  • Place the Release API Key hardcoded into the AndroidManifest.xml
  • Clean and rebuild the project

This is the result:

  • The Maps Activity just worked perfectly fine if the app-release.apk is installed manually to the device before upload to the Play Store.
  • The Maps Activity shows blank if the app-release.apk after the app-release.apk is uploaded to the Play Store.

Solution:

This answer solved the issue I am facing. The reason the Maps activity shows blank previously because Google Play re-signs the app with the original app signing key I've provided. So just copy the Google SHA-1 and paste it to the console where the Google Map API Key is generated.


回答1:


If GMap activity is added in any project then there are two google_maps_api.xml.
One is for Debug and One is for Release.

Probably you've entered the key in Debug only as when we add Gmap activity, only google_maps_api.xml opens. So put your key in Release also. How?...see.

  1. Click on TODO on the Bottom bar of Android Studio.
  2. Click on scope Based tab of TODO.
  3. Now there are two google_maps_api.XML, open each and copy your key to XML with no key (YOUR_KEY_HERE). This also happened with me.



回答2:


You have missed adding the permission, try checking by including the permission.

<uses-permission android:name="android.permission.INTERNET" />


来源:https://stackoverflow.com/questions/45603666/maps-activity-blank-after-uploaded-to-play-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!