在发布版本谷歌地图API键不起作用 [英] Google Maps API Key in release build doesn't work

查看:165
本文介绍了在发布版本谷歌地图API键不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发Android应用程序,我使用谷歌地图API。在开发者控制台,我说我的SHA1证书打印,其次是我的包的名字。
即使我使用密钥工具把这个SHA1证书打印,我无法访问的地图。
我做了很多的搜索,但每一个主题把我带到哪里的答案是错误在开发者控制台一个错误的API密钥。
但我选择了正确的SHA1,我的证书之一。

I'm currently developing an application for Android and I'm using Google Maps API. In developer console, I added my SHA1 certificate print, followed by my package name. Even though I put this SHA1 certificate print using keytool, I can't access to the maps. I made lots of search, but every topics brought me to answers where error were in a wrong API Key in developer console. But I took the right SHA1, the one of my certificate.

在此先感谢!

推荐答案

我有这个同样的问题,这是超级沮丧。我落得这样做是考虑我提出用我的版本的密钥库,并把它在谷歌开发者控制台的关键。然后,添加以下到Android清单。

I had this same problem, it was super frustrating. What I ended up doing was taking the key I made using my release keystore and putting it in the google developers console. Then, added the following into the android manifest.

<meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="KEY GOES HERE"/>

我敢肯定,你阅读本文档,但要确保遵循了释放证明,以点的说明。

I'm sure you read the documentation on this, but make sure you follow the instructions for the release certificate to the dot.

https://developers.google.com/maps/documentation/android/signup

您也可以按照在该google_maps_api.xml文件为您生成的链接。这种自动进入关键开发者控制台的过程。但是,请确保您还添加元数据值到您的清单。

You could also follow the link that was generated for you in the google_maps_api.xml file. This automates the process of entering the key into the developer console. However, make sure you still add that meta data value into your manifest.

这篇关于在发布版本谷歌地图API键不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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