Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Google Map doesn't display

Tags:

android

key

map

Please excuse my bad English, I'm French !

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).

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

And the package name is : com.example.mapdemo

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

But it doesn't work...

Have you got an idea ?

Thanks a lot !

like image 886
Florian Mac Langlade Avatar asked Jun 17 '13 12:06

Florian Mac Langlade


1 Answers

Please check..

  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.

  2. 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 ".

  3. 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.

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

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.

like image 109
GOLDEE Avatar answered Oct 02 '22 17:10

GOLDEE