6

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 !

Florian Mac Langlade
  • 1,863
  • 7
  • 28
  • 57

4 Answers4

11

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.

GOLDEE
  • 2,318
  • 3
  • 25
  • 49
2

First of all, you should change the package name to something related to you or your company.

Did you sse the SHA-1 value ? It's something like that 53:65:C7:89:2A:5D:87:D4:47:FD:FD:74:32:1D:34:C7:9A:68:A7:8F. Once you have it, you can request an api key here https://code.google.com/apis/console/ in the API Acces section. Then put the key in your manifest.

Note : You will need to do this again when you will publish your app and not use the debug key anymore.

And, it can take a bit time after you registered your application.

Stephane Mathis
  • 6,542
  • 6
  • 43
  • 69
  • Thanks. This is my case. "And, it can take a bit time after you registered your application." – zono Dec 06 '14 at 11:04
  • I don't understand what's needed to be done when releasing the app because i didn't do anything and when i test my app on other devices the map does not appear. – sarfarazsajjad Aug 11 '15 at 11:38
1

ensure that device has Google Play services APK * to install Google Play Service rev. more than 2

abhi
  • 759
  • 6
  • 15
-4

Simply generate and add your own map api key in the manifest file.

deo
  • 916
  • 7
  • 8