Android Maps API2版本密钥在本地工作,但不能通过Play Store [英] Android Maps API2 release key working locally but not through Play Store

查看:177
本文介绍了Android Maps API2版本密钥在本地工作,但不能通过Play Store的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个使用Google Maps API V2的应用程式。当在调试模式下构建应用程序时,使用调试键,地图显示正常。当我使用Eclipses导出功能和我的生产密钥导出应用程序时,在本地安装应用程序也是如此:

I am making an app that uses the Google Maps API V2. When building the App in debug mode, using the debug key the map gets displayed fine. The same is true, when I export the app using Eclipses export function and my production key, installing the app locally with:

adb install com.package.name

然而,当我在Play商店发布apk(作为alpha测试)并将其下载到我的设备上,不会显示任何地图,使我怀疑钥匙出现问题。

However when I publish the apk in the Play Store (as an alpha test) and download it on my device, no map is displayed, making me suspect that something goes wrong with the key.

我在API控制台中注册了生产密钥并更改了地图在清单中键入新密钥,因此当我通过ADB安装它时,它的工作原理。

I registered the production key in the API console and changed the maps key in the manifest to the new key, hence it works when I install it through ADB.

我还从Play Store重新安装并卸载了该应用程序,从API控制台中删除我的调试密钥,以确保释放密钥被使用(从而正常工作)。

I also uninstalled the app, before the reinstallation from the Play Store and removed my debug key from the API console, to make sure that the release key gets used (and thereby is working correctly).

任何帮助将不胜感激。 p>

Any help would be greatly appreciated.

推荐答案

这是一个迟到的回复,但我认为这可能会帮助那些可能遇到这个类似问题的人。我也已经正确地生成了所有的发行版/调试按钮,并且通过ADB安装,我的签名发行版apk上的映射功能很好,但是在上传到Google Play商店之后,并不是这样。

This is a late response, but I thought it might help others who might run into this similar problem. I too had all my release/debug keys generated correctly and the maps on my signed release apk works well through ADB install, but not after uploading to Google Play Store.

是我的解决方案:使用新的可选Google Play应用签名功能,您的最终SHA1可以在Google Play控制台 - >发布管理 - >应用签名中找到。将应用程序签名证书的SHA1添加到您的API控制台中的API的密钥限制列表中,您的地图应该可以正常工作。

Here is my solution: With the new optional "Google Play App Signing" feature, your final SHA1 can be found in your Google Play Console -> Release Management -> App Signing. Add the SHA1 for the app signing certificate to your key restriction list for the API in your API console and your map should be working.

显然,生成的SHA1使用我自己的密钥库(释放)在上传到Google Play商店之前不同于最后一个。

Apparently the generated SHA1 using my own keystore (release) prior to uploading, is different from the final one, after uploading into Google Play Store.

希望这有帮助。

这篇关于Android Maps API2版本密钥在本地工作,但不能通过Play Store的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆