简体   繁体   English

APK发布后,Android Google地图无效

[英]Android Google Maps Not Working After APK Release

I have Android app which include Google Maps It was working fine before releasing the app, but after releasing the maps are not shown . 我有Android应用程序,其中包括谷歌地图它在发布应用程序之前工作正常,但在发布后没有显示地图。 Although I've added SHA-1 certificate fingerprint from google console after releasing and added it to the restrected apps 虽然我在发布后从谷歌控制台添加了SHA-1证书指纹,但将其添加到了重新建立的应用程序中

SHA-1 after releasing 发布后的SHA-1

API Key Restrictions API密钥限制

So the 2 SHA-1 are included with the package name, the Maps works fine when running the app directly from android studio, but it shows nothing when downloading the app from playstore, any Ideas ? 所以2个SHA-1包含在包名中,地图可以直接从android studio运行应用程序,但是从Playstore下载应用程序时没有显示任何内容,任何想法?

It's because Google Play is signing app with different SHA-1 Fingerprint, so you need to take it and register in google developer's console 这是因为Google Play使用不同的SHA-1指纹签署应用程序,因此您需要在Google开发人员的控制台中注册并注册

在此输入图像描述

I recently had the same problem. 我最近遇到了同样的问题。 Please make sure you have set your release api key on your app resources. 请确保您已在应用资源上设置了发布api密钥

In your app you might have: 在您的应用中,您可能拥有:

src/ debug /res/values/google_maps_api.xml src / debug /res/values/google_maps_api.xml

where you set your debug key and also: 您在哪里设置调试密钥以及:

src/ release /res/values/google_maps_api.xml src / release /res/values/google_maps_api.xml

where you must set your release key. 您必须在哪里设置发布密钥。 If you have created only one API Key with both SHA-1, then you must introduce the same as in debug. 如果您只创建了一个同时具有SHA-1的API密钥,则必须引入与debug相同的API密钥。

One more thing, in the Google Developers Console besides the debug SHA-1 and the Google Play Console SHA-1 I also add the release SHA-1 of the keystore I've use to sign my app. 还有一件事,除了调试SHA-1Google Play控制台SHA-1之外,在谷歌开发者控制台中我还添加了用于签署我的应用程序的密钥库的版本SHA-1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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