Google Map未显示要发布的APK的地图 [英] Google Map not showing map for release apk

查看:72
本文介绍了Google Map未显示要发布的APK的地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题已经在这里进行了讨论,但是没有任何解决方案可以帮助我. Google地图是灰色"的,但是刚刚发布(当我构建时生成签名的APK).我尝试将API密钥添加到release文件夹下的google_maps_api.xml中,但这没有用.另外,我尝试将API正确添加到AndroidManifest.xml,但也没有结果.感谢您的帮助.

I have the problem that has been discussed here but without any solution helps me. The Google map is "gray" but just in release (when I build generate signed APK). I have tried to add API key to google_maps_api.xml under release folder but that didn't work. Also, I tried to add API right to the AndroidManifest.xml but with no result too. Thanks for the help.

推荐答案

在生成Google Maps密钥时,您是否放置了调试代码或发行证书的SHA-1?如果您放置调试SHA-1,请同时添加发布.

When you generated your Google maps key, did you put SHA-1 of your debug, or of your release certificate? If you put debug SHA-1, add release also.

此外,进行地图实施的正确方法是使用带调试密钥的debug/res/values/google_maps_api.xml和带生产密钥的另一个release/res/values/google_maps_api.xml. strings.xml中不应包含密钥.有关此内容的更多信息,您可以在此处阅读.

Also, proper way to do map implementation would be to have debug/res/values/google_maps_api.xml with key for debug and another release/res/values/google_maps_api.xml with key for production. There shouldn't be key in strings.xml. More about this you can read here.

这篇关于Google Map未显示要发布的APK的地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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