谷歌地图发布 API 密钥不起作用 [英] Google map Release API Key not working
问题描述
您好,我正在使用谷歌地图 API,但在创建发布版 APK 时遇到了问题.但 Map 在调试版本中工作正常.我按照此 link 创建了用于发布的 API 密钥.首先,我通过在终端 keytool -list -v -keystore your_keystore_name -alias your_alias_name
中键入来获得 SHA1 密钥.使用此密钥,我从 Google Developer Console 为 Android 创建了一个 API 密钥.有什么我做错了.请帮帮我.
Hi I am using google maps API, and I am having issues while creating a release APK. but Map is working fine in debug build. I created API key for release by following this link. First I got SHA1 key by typing in terminal keytool -list -v -keystore your_keystore_name -alias your_alias_name
. Using this key I created An API key from Google Developer Console for android. Is there anything I am doing wrong. Please help me.
推荐答案
我得到了解决方案.我在错误的位置添加了 API 密钥.我错误地在 src/debug/res/values/google_maps_api.xml
中添加了 release API key
.当我将它复制到 src/release/res/values/google_maps_api.xml
时,它起作用了.
I got the solution. I was adding API key at wrong location. I added release API key
inside src/debug/res/values/google_maps_api.xml
mistakenly. When I copied it to src/release/res/values/google_maps_api.xml
it worked.
这篇关于谷歌地图发布 API 密钥不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!