【问题标题】:Google Maps API cannot retrieve UIGoogle Maps API 无法检索 UI
【发布时间】:2016-06-17 07:28:05
【问题描述】:

我正在尝试构建一个谷歌地图应用程序。该应用程序运行,但我无法检索地图 UI。

日志显示:授权失败。请参阅https://developers.google.com/maps/documentation/android-api/start 了解如何正确设置地图。 06-16 22:45:50.480 13860-14718/com.mapsapi.vatsan.googlemapsapidemo E/Google Maps Android API:在 Google 开发者控制台中 (https://console.developers.google.com) 确保启用了“Google Maps Android API v2”。 确保存在以下 Android 密钥: API 密钥:************************************** Android 应用程序 (;):24:85:5A:C0:F8:0D:36:4C:1A:B9:45:B6:21:92:B0:6E:7D:71:55:08;com.mapsapi。 vatsan.googlemapsapidemo

我使用了正确的 API 密钥。

我到底要做什么?

【问题讨论】:

    标签: google-maps


    【解决方案1】:

    我知道调试和发布的应用程序有不同的键。 我也推荐 API v3。

    试试这个来注册你的 api 密钥。

    https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=24:85:5A:C0:F8:0D:36:4C:1A:B9:45:B6:21:92:B0:6E:7D:71:55:08%3Bcom.mapsapi.vatsan.googlemapsapidemo 可能需要几分钟。然后你必须在你的 android 应用 Manifiest 中设置你的 google_maps_key。

    <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSDSSDDDAAD...Your API KEY" />
    

    如果不起作用并且您使用的是 android studio,请尝试创建一个新的 Map Activity(它是 V3),使用密钥完成 res/values/google_maps_api.xml,然后地图就会工作。 How to create google map

    【讨论】:

    • 原生 api v2 和 JavaScript api v3 的区别是什么?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-22
    • 1970-01-01
    • 2020-10-07
    • 1970-01-01
    • 2016-06-17
    • 1970-01-01
    相关资源
    最近更新 更多