Google Maps API(9757):授权失败 [英] Google Maps API ( 9757): Authorization failure

查看:99
本文介绍了Google Maps API(9757):授权失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android Studio 3.1.3
Android 6.0
摇篮4.4

Android Studio 3.1.3
Android 6.0
Gradle 4.4

我想获取新的Google Map api密钥.所以这是我的步骤:

I want to get new Google map api key. So here my steps:

  1. 在Android Studio中的android项目中,我打开文件:"googel_maps_api.xml"

  1. In my android project in Android Studio I open file: "googel_maps_api.xml"

将下一个网址复制到剪贴板:

Copy to clipboard the next url:

在Google控制台中,我选择我的项目,然后单击按钮

In google console I select my project and click button

  1. 单击按钮以创建新的密钥api
  1. Click button to create new key api

这里结果

  1. 在字段" google_maps_key

在清单文件中添加元数据 android:name ="com.google.android.geo.API_KEY" :

In manifest file add meta data android:name="com.google.android.geo.API_KEY" :

我在这里使用的Google api:

Here google api that I use:

  1. 重新启动我的android应用

  1. Restart my android app

但是在logcat上我得到了错误:

But on logcat I get error:

    E/Google Maps Android API( 9757): Authorization failure.  Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
    E/Google Maps Android API( 9757): In the Google Developer Console (https://console.developers.google.com)
    E/Google Maps Android API( 9757): Ensure that the "Google Maps Android API v2" is enabled.
    E/Google Maps Android API( 9757): Ensure that the following Android Key exists:
    E/Google Maps Android API( 9757):   API Key: AIzaSyCTvKejzCdZxxxxxxxxxxSIPG9DkegNss4-VJ8fjVt4
    E/Google Maps Android API( 9757):   Android Application (<cert_fingerprint>;<package_name>): B7:CE:53:19:C4:xx:Bxx2C:C6:51:35:AD:32:47:1E:53:6B:1A:0D:B9;com.myprojectcustomer.debug

结果,该地图没有显示.

And as result the map is not show.

推荐答案

进行检查,以确保已为Google API控制台中的特定项目启用了Maps SDK for Android.还要在您的Google API控制台中查看应用程序限制"以获取该特定密钥.如果您选择了"Android应用",则程序包名称和SHA-1指纹必须与您的Android项目的程序包名称和google_maps_api.xml文件中生成的SHA-1指纹相匹配.您还可以在应用程序限制"中选择无",所有要做的就是在google_maps_api.xml文件中放置正确的API密钥.

Check to make sure you have Maps SDK for Android enabled for the specific project in your Google API console. Also check the "Application Restrictions" for that particular key in your Google API Console. If you have "Android apps" selected, the package name and the SHA-1 fingerprint must match the package name of your Android project and the SHA-1 fingerprint generated in your google_maps_api.xml file. You can also select "None" in the "Application Restrictions" and all you need to do is place the correct API Key in your google_maps_api.xml file.

这篇关于Google Maps API(9757):授权失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆