谷歌地图API V2 - 总是得到验证错误 [英] Google Maps API V2 - always get authentication error

查看:257
本文介绍了谷歌地图API V2 - 总是得到验证错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了很多的问题,关于这个 - 我几乎羞于问我自己

I found lots of questions regarding this - and I am almost ashamed to ask it myself.

但不管我怎么努力,我简单的没有得到地图API的所有正在运行的的!

But no matter how hard I try, I simple do not get the Maps API running at all!

不与示范项目,com.example.mapdemo,不符合我自己的项目。

Not with the demo project, com.example.mapdemo, not with my own project.

我肯定有我的debug.keystore SHA1指纹注册,现在为我的应用程序和com.example - 我也试过在浏览器API密钥,每个人都表示,会工作,太

I definitely have my debug.keystore SHA1 fingerprint registered, now for both my app and com.example - I also tried the browser API key where everybody says that would work, too.

但没有。

我总是得到:

06-16 11:21:29.860: E/Google Maps Android API(2382): Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.

我得到真的,真的疯了这一点。这怎么可能并不完全,彻底地描述了这件事情,让人们在其他方面能够编程的Andr​​oid应用程序,可以跟踪并成功??

I am getting REALLY, REALLY mad at this. How is it possible to NOT completely and thoroughly describe this matter so that people that are otherwise able to program Android apps, can follow and succeed??

怎么样?

有谁请告诉我还有什么地方出错了?

Could anybody please tell me what else could be wrong?

附加:我设置了一切根据规格完全相同,拿我的钥匙从我debug.keystore,试图与它com.example的地图演示,用我自己的包,我的应用程序。不工作。 加:那个傻空的窗口。如何在地球上是要去工作...: - (

Add-on: I set up everything exactly according to the specs, got my key from my debug.keystore, tried it with com.example for the maps demo, with my own package for my app. Does not work. Plus: that silly empty window. How on earth is that gonna work... :-(

推荐答案

假设

  • 您是能够访问谷歌播放业务的设备上尝试这种
  • 您已将自己的项目与谷歌播放服务库
  • 您已经设置这样的必要的权限:

这是明显的片断:

<!-- Specify the correct minSDK and targetSDK versions. -->
<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<!-- Google Maps related permissions -->
<permission
    android:name="com.ecs.google.maps.v2.actionbarsherlock.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE" />

<!-- Network connectivity permissions -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<!-- Access Google based webservices -->
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

  • 您已经安装这样的地图键:
    • 您已经把元数据标记应用程序标记

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyA_u1faIXRhx_Q7NafFbrhQJEerl6UUbPY" />
    

  • 您确信您正在构建的APK用正确的密钥库(对应于API控制台中定义的)。

  • you made sure that you are building the APK with the correct keystore (corresponding to the one defined in the API console).

    这是我的经验,我能够遵循谷歌地图Android的API V2说明书入门,但我确实记得不得不完全取消部署和重新部署应用程序之后,再次与API密钥/权限玩耍。

    From my experience I was able to follow the instructions on Google Maps Android API v2 Getting started, but I do recall having to completely undeploy and redeploy the app again after playing around with the API keys / permissions.

    在您运行的是什么设备?

    On what device are you running ?

    这篇关于谷歌地图API V2 - 总是得到验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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