Google Maps API V2 'Failed to Load Map. Could not contact Google Servers'

StuStirling picture StuStirling · Dec 5, 2012 · Viewed 27.2k times · Source

I have checked and double checked my APIkey that I registered on the Google Console however I am still getting the following error:

12-05 16:31:12.940: E/Google Maps Android API(12334): Failed to load map.  Could not contact Google servers.

What I am seeing is the zoom in/out buttons and the background for the MapView but no Map???!!!

Any ideas???

Answer

I will post it here because what solved my issue was stated in the comments of the accepted answer below.

It was the READ_GSERVICES permission. For some reason the permission wasn't mentioned on the developer site when it came to using them.

Answer

Matt Clark picture Matt Clark · Dec 5, 2012

For setting up Google Maps API v2 on Android, make sure that you have completed all of the following steps.

App Key For API Access

When Google asks for the SHA1 fingerprint of your app certificate, you will want most likely want to run this twice, once for your debuging certificate, and once for your publishing certificate.

keytool -list -v -keystore publishcert.keystore
keytool -list -v -keystore ~/.android/debug.keystore

The fingerprint of the app on the market is different then the fingerprint of an app that you are just testing!

Enable the service on the Google API Console

Login to the Google API Console.
On the services page, find Google Maps Android API v2.

Note - Google Maps API v2 is DIFFERENT then Google Maps Android API v2

In the API Access tab, click Create new Android Key

Add your certificate signatures for access to the APIs.

yourrelease-fingerprint;com.example.project.package
yourdebug-fingerprint;com.example.project.package

You will be provided with a generated API Access Key.

You may need to first create an API Project in the API Console

Amend the App Manifest

Add your API Key, inside of the <application> element.

<meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="yourapikey"/>

Add the following permissions:

<permission
        android:name="com.example.project.package.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>

<uses-permission android:name="com.example.project.package.permission.MAPS_RECEIVE"/>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>

Add the following feature request:

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />