繁体   English   中英

Google Maps Android V2中的授权失败

[英]Authorization Failure in Google Maps Android V2

当我尝试调试我的项目时,使用调试证书收到此错误

在此处输入图片说明

我已经确保我的软件包名称和SHA-1与我的api密钥相对应

这是我的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"  android:installLocation="auto" package="com.example">
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="15" />
    <!-- Google Maps for Android v2 requires OpenGL ES v2 -->
    <uses-feature android:glEsVersion="0x00020000" android:required="true" />
    <!-- We need to be able to download map tiles and access Google Play Services-->
    <uses-permission android:name="android.permission.INTERNET" />
    <!-- Allow the application to access Google web-based services. -->
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <!-- Google Maps for Android v2 will cache map tiles on external storage -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!-- Google Maps for Android v2 needs this permission so that it may check the connection state as it must download data -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!-- Permission to receive remote notifications from Google Play Services -->
    <!-- Notice here that we have the package name of our application as a prefix on the permissions. -->
    <uses-permission android:name="com.example.permission.MAPS_RECEIVE" />
    <permission android:name="com.example.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
    <!-- These are optional, but recommended. They will allow Maps to use the My Location provider. -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <application android:label="map" android:icon="@drawable/Icon">
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
    <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="map_key" />
</application>
</manifest>

这是我的API KEY

在此处输入图片说明

这是我的SHA-1证书

我使用Eclipse获取了SHA-1

在此处输入图片说明

顺便说一下,我在调试项目时使用的是真实设备,C#,Visual Studio 2012和xamarin.android。 它仅显示带有Google徽标的白屏以及放大和缩小按钮。 我的调试证书怎么了?

如果密钥是新密钥(刚刚在Google APIs Console中创建),则需要花费一些时间才能将其用于Google Maps。

不用担心一切都被声明为正常,这只需要一些时间。

编辑:通过写在日志中的内容看起来,您必须为调试密钥存储区:D9595添加指纹。

只需在Google API控制台中添加带有该指纹的新行即可。 您的调试密钥库位于C:\\ Users \\ .android \\ debug.keystore,默认密码为:android

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM