Google地图发布API密钥无法使用 [英] Google map Release API Key not working
问题描述
您好我正在使用Google Maps API,并且在创建发布APK时遇到问题。但Map在调试版本中工作正常。我按照链接创建了发布API密钥。首先,通过在终端 keytool -list -v -keystore your_keystore_name -alias your_alias_name
中输入SHA1密钥。使用此密钥,我为来自 Google开发者控制台的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.
这篇关于Google地图发布API密钥无法使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!