且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Google Maps API无法检索用户界面

更新时间:2023-12-04 15:46:53

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



试试这个来注册你的api key。

https://console.developers.google.com/flows/enableapi?apiid= maps_android_backend&安培;关键字类型= 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。

 <元数据
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。
如何创建Google地图


I am trying to build a google maps app. The app runs but I am unable to retrieve the map UI.

Logs shows :Authorization failure. Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map. 06-16 22:45:50.480 13860-14718/com.mapsapi.vatsan.googlemapsapidemo 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: ************************************** Android Application (;): 24:85:5A:C0:F8:0D:36:4C:1A:B9:45:B6:21:92:B0:6E:7D:71:55:08;com.mapsapi.vatsan.googlemapsapidemo

I have used the correct API Key.

What exactly i have to do?

I know there are diferent keys for debug and released apps. i recomend API v3 too.

Try this to register your api key.

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 It can take some minutes. Then you have to set your google_maps_key in your android app Manifiest.

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

If doesnt work and if you are using android studio, try creating a new Map Activity(It's V3), complete res/values/google_maps_api.xml with the key and the map gonna work. How to create google map