android - 从 Play 商店下载 apk 后,谷歌地图无法在 Android 中运行

标签 android google-maps google-maps-android-api-2

大家好我正在开发 map 应用程序。我的问题是当我创建发布版本并在我的真实设备上安装这个版本时 map 正在加载但是在将相同的版本上传到播放商店并下载到我的真实设备之后Google map 未加载并出现错误

E/Google Maps Android API: Authorization failure.  Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.

04-25 18:05:27.159 10524-10703/? E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
    API Key: AIz~~~~~~~~~~~~~~~~~~~~~~~~~~~0
    Android Application (<cert_fingerprint>;<package_name>)

有谁知道我为什么会收到此授权失败?我在 Google API 的控制台 中添加了要发布的 SHA1。我也尝试了新 key 但没有运气。我已经在 Stackoverflow 上花了 2 天时间,但运气不好。

最佳答案

您必须在 AndroidManifest.xml 中设置一个新的 GEO API key ,该 key 不同于您在开发期间使用的 key 。在不以开发模式运行的情况下使用新 key 上传应用程序,它会正常工作。

关于android - 从 Play 商店下载 apk 后,谷歌地图无法在 Android 中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50022759/

相关文章:

java - 查询索引数据库的java代码与查询未索引数据库的java代码相同吗?

android - 提醒申请

android - 无法从android中的谷歌地图中心获取latlong

android - Google Map Android API V2 中两个位置之间的旅行时间

android - 如何在 Android google map V2 api 上更改语言

android - 任何人都可以向我解释这些代码吗?创建自定义布局控件

java - Activity 应该直接访问 sqlite 数据库还是应该有一个中介类?

google-maps - Google Maps API 同步地理编码

java - 如何在android中获取谷歌地图蓝点纬度和经度

mysql - 查找特定角度附近的位置 - 在圆形查询中仅考虑前面的半圆而不是后面