简体   繁体   English

Google Maps在发行中不起作用

[英]Google Maps Not Working in Release

I have seen several questions about this on stackoverflow, I have gone through them and tried to understand them but it's either not very clear or I am doing something wrong. 我已经在stackoverflow上看到了几个与此有关的问题,我已经遍历了它们并试图理解它们,但这不是很清楚,或者我做错了什么。

I have generated my API keys in my google console, Key Restrictions has been set to None so I do NOT need to specify my App ID or SHA1 certificate fingerprint as some of those posts I've read have implied. 我已经在Google控制台中生成了API密钥,“密钥限制”已设置为“ 无”,所以我不需要指定我的App ID或SHA1证书指纹,因为我已经读过其中的一些文章。

However my maps only show in debug and not in release, I have tried in my emulator and on phone with different android versions, I have checked my permissions now I do not know what to do. 但是我的地图只显示在调试中,而不显示在发布中,我已经在模拟器和具有不同android版本的手机中尝试过,我已经检查了权限,但现在不知道该怎么做。

I would like clear steps on how to get my maps working in my release version. 我想知道如何在发布版本中使用地图的清晰步骤。
There are already questions like this but like I said I have gone through them and the solutions either did not work for me or were dated and not clear enough. 已经有这样的问题,但是就像我说过的那样,解决方案要么对我不起作用,要么过时且不够清晰。

Okay so I'm new to google maps, apparently there were 2 google_maps_api.xml files, one for debug and one for release. 好的,所以我是google map的新手,显然有2个google_maps_api.xml文件,一个用于调试,一个用于发布。

I noticed the one for release did not have an API key assigned so I just copied my existing key over there and now it works just fine. 我注意到要发布的密钥没有分配API密钥,因此我只是将现有密钥复制到了那里,现在可以正常使用了。

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

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