Google 将应用上传到 Playstore 后地图未显示

Google maps not showing after uploading the app to playstore

Google 地图在将应用上传到 Playstore 后显示空白屏幕。但是 Map 在本地显示 运行 时(在模拟器中)。 我尝试通过 Playstore 应用签名证书 SHA 指纹更改 google 映射 api 的 SHA1,但仍然显示空白屏幕。

请运行首先在真实设备中安装应用程序,如果可以正常运行,请按照以下步骤操作。

If u have enabled the App Signing Feature in the Developer Console, then it's clearly written in the documentation that the Upload Certificate is only needed by Google for authentication and that upload certificate is removed before installing the application on the user's phone. So, u also need to give the App Signing Certificate SHA under the key which you have enabled for Google Maps API. The App Signing Page is as I have attached the screenshot for your convenience... In the image I have marked which you need to give as additional credentials

您可以轻松获得用于发布的 SHA1 密钥。

在您的 Gradle 中输入您的发布密钥详细信息,如下所示。

signingConfigs {
        release {
            storeFile file("F:/Development/release_myapp.keystore")
            storePassword "231232das"
            keyAlias "myapp_rel"
            keyPassword "dasd333_das"
        }
    }

然后 运行 signingReport 在 Gradle 任务中:

您将在 运行 window.

中获得版本 SHA

如果您选择了 Google Play 应用签名功能,您还需要另一个由 [=39= 生成的控制台 SHA 密钥].按照 Zoffa 的回答进行操作。

更多信息来源:http://devdeeds.com/create-sha1-key-using-android-studio/

感谢大家的回答。

应用程序中有两个 google_maps_api.xml 文件,一个用于调试,另一个用于发布。

发布:app\src\release\res\values\google_maps_api.xml

调试:app\src\debug\res\values\google_maps_api.xml

在我的例子中,api 键在 google_maps_api.xml

版本中是空白的

据我所知,调试密钥和发布密钥的 SHA1 密钥不同。但是上传到play store后就不行了。要显示地图,您应该按照以下步骤操作。 - 转到 https://play.google.com/apps/publish/signup 在那个去发布选项。从 App 签名证书复制 SHA1 密钥 - 在编辑为您的应用程序生成的 API 密钥时粘贴它。 注意:您的 API 应该出现在调试和发布 xml 文件中。