Android的 - 谷歌地图不显示 [英] Android - Google Map doesn't display

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

问题描述

请原谅我的英语不好,我是法国人!

Please excuse my bad English, I'm French !

我有一个关于我的Andr​​oid应用程序的问题... 我哈瓦整合了谷歌地图,让我跟着(从谷歌developper网站)的教程,但是当我在尝试谷歌演示我有一个空白的地图!不显示任何内容,我已经得到了这个错误:

I've got a question about my Android App... I hava to integrate a google map, so I've followed a tutorial (from Google developper website), but when I when to try the Google Demo I've got a blank map ! Nothing is displayed and I've got this error :

06-17 14:34:29.067: E/Google Maps Android API(29152): Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
06-17 14:34:29.067: E/Google Maps Android API(29152): Ensure that the following correspond to what is in the API Console: Package Name: com.example.mapdemo, API Key: AIzaSyBWkgi7WlIhPRT8UQtxyIlz4yr9UZ3qE5c, Certificate Fingerprint: ADFDA5FBEEFC1C02BEFD197CD30B3A581327107D
06-17 14:34:29.887: E/Google Maps Android API(29152): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).

我一直都在为了得到SHA-1执行以下命令:

I've have executed this command in order to get the SHA-1 :

C:\Program Files\Java\jdk1.7.0_21\bin>keytool -list -alias androiddebugkey -keystore C:\Users\AZS\.android\debug.keystore -storepass android -keypass android -v

和包名是:com.example.mapdemo

And the package name is : com.example.mapdemo

我已经激活的谷歌地图Android的API v2和放大器;谷歌地图API V2到服务选项卡。

I've activated Google Maps Android API v2 & Google Maps API v2 into the service tab.

不过,这并不工作...

But it doesn't work...

你有一个想法?

非常感谢!

推荐答案

请检查..

  1. 检查是否存在于你的项目中包含了Android的支持 - v4.jar的库文件夹中。 Android的支持 - v4.jar位于/extras/android/compatibility/v4/android-support-v4.jar在你的Android的SDKdrectory。

  1. check if the "libs" folder containing the "android-support-v4.jar" exists in your project. "android-support-v4.jar" is located in "/extras/android/compatibility/v4/android-support-v4.jar" under your "android-sdk" drectory.

运行项目之前,必须设置你的项目构建的目标,以谷歌API的,而不是Android的XX版本:选择你的项目,然后单击在Eclipse项目>属性>项目构建目标,并选择任何谷歌API的,然后在手机上运行您的项目。如果使用模拟器,还必须设置仿真器连接到任何谷歌的API的AVD。

Before running your project, you must set your project Build target to "Google APIs", not Android x.x. version : Select your project and click Project > Properties > Project Build Target in Eclipse and select any "Google APIs ", and then run your project on your phone. If you use the emulator, also MUST set the AVD of the emulator to the any "Google APIs ".

再次,你不需要为了创建新的谷歌地图API密钥,以测试你的项目,只要使用默认提供的API密钥,表示为键浏览器的应用程序(与查阅情况) 在你的谷歌API控制台。

Once more, you don't need to create the new Google Maps API key in order to test your project, Just use the default provided API key, which is shown as "Key for browser apps (with referers) "in your Google APIs Console.

最后,最重要的是加入谷歌Play业务作为一个Android库项目如下:

Finally, the most important is to add Google Play services as an Android library project as follows:

选择文件>导入> Android的>现有的Andr​​oid code进入工作区,然后单击下一步。选择浏览...,输入/演员/谷歌/ google_play_services / libproject /谷歌播放-services_lib,然后单击Finish。

Select File > Import > Android > Existing Android Code Into Workspace and click Next. Select Browse..., enter /extras/google/google_play_services/libproject/google-play-services_lib, and click Finish.

这篇关于Android的 - 谷歌地图不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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