问题描述
我有带有Google地图的Android应用.
I have Android app with Google maps.
如果我直接将APK构建并安装到手机上,则它的调试和发行版APK可以正常工作.
Debug and Release versions of APK works fine if I build and install it directly to phone.
但是,当我从Google Play安装APK(进行Alpha或Beta测试)时,没有显示地图(黑屏).
But when I install the APK from Google Play (Alpha or Beta testing), maps are not shown (blank screen).
我当然在发行XML文件中有API密钥,依此类推...我不明白,为什么同样的APK也可以,如果我直接将其安装到手机上,并且如果该APK是通过Google Play安装的,则不会显示地图.
I have of course API key in release XML file and so on...I cannot understand, why same APK is okay, if I install it directly to phone and maps is not shown if this APK is installed via Google Play.
有什么建议吗?
推荐答案
我发现了一个问题.我们团队中的某人为此应用启用了(接受)"Google Play应用签名"功能(在此处查看更多信息).因此,将SHA从Google Play控制台添加到Google控制台(API密钥)即可解决此问题.
I found a problem. Somebody from our team enabled (accepted) "Google Play App Signing" for this app (see more here). So adding SHA from Google Play Console to Google Console (API key) solved this problem.
这篇关于如果通过Google Play安装了APK,则Google地图无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!