【问题标题】:How to Activate the Google Maps Android API v2 its not listed如何激活未列出的 Google Maps Android API v2
【发布时间】:2015-09-13 10:07:51
【问题描述】:

我遇到以下错误:

    09-13 15:13:56.147: E/b(356): Authentication failed on the server.
    09-13 15:13:56.147: E/Google Maps Android API(356): Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
    09-13 15:13:56.157: E/Google Maps Android API(356): In the Google Developer Console (https://console.developers.google.com)
    09-13 15:13:56.157: E/Google Maps Android API(356): Ensure that the "Google Maps Android API v2" is enabled.
    09-13 15:13:56.157: E/Google Maps Android API(356): 

控制台中没有列出现在该怎么办我怎样才能得到地图

【问题讨论】:

    标签: android google-maps android-maps-v2


    【解决方案1】:

    我已经解决了这个问题:

    1. 将您的 google play 服务更新到最新并重建项目

    2. 有 2 种不同的 API KEY 应该应用,一种用于调试,一种用于发布,如果您使用 Map 模板创建项目会更容易,因此您将在项目中获得 goole_map_API.xml。如果您使用空白/空项目,只需在 src\debug\res\values 文件夹和 src\release\res\values\ 文件夹上创建 google_map_API.xml

    3. 要在 google_maps_apis.xml 上创建调试 API 密钥,您将获得链接,复制该链接并在浏览器中打开,使用该链接创建凭据密钥。您将从调试文件中获得的链接示例:

    To get one, follow this link, follow the directions and press "Create" at the end:
    
    https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=70:52:69:E7:6F:B9:61:62:C4:8B:F2:1D:A2:28:FE:55:43:4F:FF:08%3Bcom.devdov.myapplication
    
    1. 获取调试密钥后,将 API KEY 输入到您的 src\debug\res\values\google_map_APIS.xml。

    2. 最后一件事是为发布版本创建自己的 API KEY,将 API KEY 放入 src\release\res\values\google_map_APIS.xml。

    3. 重建您的项目

    经过一天多的搜索和尝试,此步骤对我有用

    【讨论】:

      【解决方案2】:

      假设您已经在控制台中创建了一个项目,它就在控制台中列出:

      然后您必须通过凭据部分来创建 API 密钥。

      【讨论】:

      • 您是否使用相同的 packageName 设置了凭据?
      • 所以,可能为时已晚,但我也遇到了完全相同的事情,我通过在 SDK 管理器中更新 Google Play 服务并在 gradle 中设置最新版本来解决。
      猜你喜欢
      • 1970-01-01
      • 2019-03-28
      • 1970-01-01
      • 2017-01-31
      • 2013-03-24
      • 2023-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多