Android - Google Map not showing

Please excuse my bad English, I'm French!

I have a question about my Android application ... I want to integrate a google map, so I followed the tutorial (from Google Developer), but when I try to use Google Demo, I have an empty map! Nothing is displayed, and I have 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 ran this command to get 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 package name: com.example.mapdemo

I have activated Google Maps Android API v2 and Google Maps API v2 in the service tab.

But this does not work ...

Do you have an idea?

Thanks a lot!

+6
source share
4 answers

Please check..

  • check if the folder "libs" containing "android-support-v4.jar" exists in your project. "android-support-v4.jar" is located in "/extras/android/compatibility/v4/android-support-v4.jar" according to your "android-sdk".

  • Before starting a project, you must set up your project. Configure the target on the “Google API” and not on the Android xx version: Select your project and click Project> Properties> Project Build Target in Eclipse and select “Google API” and then run the project on your phone. If you are using an emulator, you MUST also install the AVD emulator on any Google APIs.

  • Once again, you don’t need to create a new Google Maps API key to test your project. Just use the default API key, which appears as the "Key for browser applications (with links)" in the Google API console.

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

Choose File> Import> Android> Existing Android Code in Workspace, and click Next. Select Browse ..., type / extras / google / google _play_services / libproject / google-play-services_lib and click Finish.

+11
source

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

Have you used the SHA-1 value? This is something like this 53:65:C7:89:2A:5D:87:D4:47:FD:FD:74:32:1D:34:C7:9A:68:A7:8F . After that, you can request the api key here https://code.google.com/apis/console/ in the Acces API section. Then put the key in your manifest.

Note. You will need to do this again when you publish the application and no longer use the debug key.

And it may take a little time after registering your application.

+2
source

make sure the device has the Google Play APK * app installed to install the version of Google Play. more than 2

+1
source

Just create and add your own map api key to the manifest file.

-4
source

Source: https://habr.com/ru/post/947471/


All Articles