Tuesday, August 20, 2013

Android: Solution for Google Maps API v2 is not working due to authentication issue


If your facing below exception when you’re trying to hit Google map.

I/Google Maps Android API(2470): Failed to contact Google servers. Another attempt will be made when connectivity is established.

E/Google Maps Android API(2470): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).

Check whether you have followed Google maps documentation,
If you feel, everything is achieved but still map is not appearing and you're getting above exception then we should check the below mentioned solution.

Solution / Checks:

When you’re facing authentication issue with your application then check two things.
1.     Whether you’re behind the proxy.
2.     Whether you’re debug.keystore file is signed or not.
If you’re using default android debug.keystore then it is not signed.

2 comments :

  1. 03-27 01:12:59.165: E/Google Maps Android API(22325): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
    03-27 01:12:59.180: E/Google Maps Android API(22325): Ensure that the following correspond to what is in the API Console: Package Name: com.example.here, API Key: AIzaSyCTTRon5xakVgIQyIFT4MQr4KSg90ooqiI, Certificate Fingerprint: 10877C9DBB0BF1B5C84C28AC1859649A2C8CDBED
    03-27 01:12:59.265: I/Google Maps Android API(22325): Failed to contact Google servers. Another attempt will be made when connectivity is established.
    03-27 01:13:05.475: D/dalvikvm(22325): GC_CONCURRENT freed 420K, 5% free 10162K/10695K, paused 2ms+2ms
    03-27 01:13:14.580: E/Google Maps Android API(22325): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).


    how to solve this problem?

    ReplyDelete
    Replies
    1. Check your SHA-1 fingerprint by using command "keytool -list -v -keystore debug.keystore."
      The debug.keystore is the file which your using in the project.

      Delete