谷歌地图V2:授权失败 [英] Google maps v2: Authorization failure

查看:263
本文介绍了谷歌地图V2:授权失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

授权失败。请参阅<一href="https://developers.google.com/maps/documentation/android/start">https://developers.google.com/maps/documentation/android/start对于如何正确地设置地图。

Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.

确保以下对应的是在API控制台:套餐名称: com.company.app <​​/ code>,API密钥: AIzaSyC ** *骨,证书指纹: 4E5285 *** 6BF53ED3 未能联系上谷歌服务器。当连接建立另一个将尝试。

Ensure that the following correspond to what is in the API Console: Package Name: com.company.app, API Key: AIzaSyC***OsTeo, Certificate Fingerprint: 4E5285***6BF53ED3 Failed to contact Google servers. Another attempt will be made when connectivity is established.

无法加载地图。错误接触谷歌服务器。这可能是一个问题的认证(但可能是由于网络错误)。

Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).

我知道有那么多关于这个问题的足够的问题。 但我似乎无法获得地图查看工作。其结果是一个空的地图视图(变焦按钮)。

I know there are more then enough questions about this subject. But I just can't seem to get the maps view to work. The result is an empty maps view (with zoom buttons).

我所做的:
- 下载/安装谷歌播放-服务。 - - 增加了谷歌播放services.jar 库/
- 已启用谷歌地图API V2 在code.google.com /原料药/控制台
- 建立正确的权限

What I've done:
- Downloaded / installed google-play-services
- Added google-play-services.jar to libs/
- Enabled Google Maps API v2 in code.google.com/apis/console
- Set up the correct permissions

这是我的表现是这样的:

This is how my manifest looks like:

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<permission
    android:name="com.company.app.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-permission android:name="com.company.app.permission.MAPS_RECEIVE" />

<application ...>
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyC***OsTeo" />
</application>

谷歌API控制台的API访问看起来是这样的:

Google APIs console api access looks like this:

Key for Android apps (with certificates)
API key:        AIzaSyC***OsTeo
Android apps:   4E:52:85:***6B:F5:3E:D3;com.company.app
Activated on:   Jun 18, 2013 11:07 PM
Activated by:   my@email.com – you

和一些code(我不明白为什么这会导致授权错误):

And some code (which I can't see why this would result in an authorization error):

FragmentManager fragmentManager = super.getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
SupportMapFragment fragment = new SupportMapFragment();
fragmentTransaction.replace(R.id.mapContainer, fragment);
fragmentTransaction.commit();

正如你可以看到我得到一个错误说包名,API密钥和证书的指纹不与谷歌的服务器相对应。但是就像我写上面,这些价值观不匹配...

As you can see I get an error saying the package name, api key and certificate fingerprint do not correspond with the google servers. But like I'm writing above, those values do match...

推荐答案

激活谷歌地图Android的API V2 服务,在谷歌API的控制台。此外,制作后的变化做应用程序的完全重新安装的设备/仿真器。

Activate the Google Maps Android API v2 service in the Google API's console. Also, after making changes do a full reinstall of the app on the device/emulator.

这篇关于谷歌地图V2:授权失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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