Failed to load map Error contacting Google servers issue with android google maps api v2

0 votes

For the past two days, I have been unsuccessfully attempting to integrate a Google Map utilising the v2 API into my Android application. Every time, all I receive is a

Failed to load map according to Google Maps Android API (16603). Contacting Google servers failed. This is possibly a problem with authentication (but could be due to network errors).


I have tried numerous times with various projects in various workspaces, tried various Google accounts, followed the setup instructions from Google (https://developers.google.com/maps/documentation/android/start), and read through numerous answers and suggestions on StackOverflow, but to no avail.

I have installed Google Play services (rev. 7) and am using Eclipse 4.2.2 with Android SDK Tools 22.01. I have also imported google-play-services lib into my workspace and added a reference to that to my

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.googlemapdemo"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<permission
    android:name="com.example.googlemapdemo.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />
<uses-permission android:name="com.example.googlemapdemo.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" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

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

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.googlemapdemo.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="my_api_key" />
</application>

</manifest>

activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/the_map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"
/>

MainActivity.java

package com.example.googlemapdemo;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;

public class MainActivity extends FragmentActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}

}

Also I created an API Project on https://code.google.com/apis/console/ where I have enabled the Google Maps Android API v2 service. Then I obtained my SHA1 debug certificate fingerprint using

keytool -list -v -keystore "C:\Users\my_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

and entered that and the package name in the API console, got the API key and put it in the manifest (where my_api_key is). This procedure I repeated a number of times, regenerating the key but with the same result.

Could anyone help with this or suggest anything else I could try? Any help will be greatly appreciated!

Nov 24, 2022 in Android by Tejashwini
• 3,820 points
486 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Android

0 votes
0 answers

How to keep marker on road? Google Maps Android

I'm working on an app that displays ...READ MORE

Nov 9, 2022 in Android by Edureka
• 12,690 points
204 views
0 votes
1 answer

Proguard returned with error code 1. (com.google.android.gms)

You must run the following command if ...READ MORE

answered Nov 15, 2022 in Android by Edureka
• 13,620 points
579 views
0 votes
0 answers

Error - Android resource linking failed (AAPT2 27.0.3 Daemon #0)

I have this error I am try reinstall ...READ MORE

Sep 21, 2022 in Android by Edureka
• 13,620 points
1,284 views
0 votes
0 answers
0 votes
0 answers

Invoke-customs are only supported starting with android 0 --min-api 26

Before, I was using Gradle build version ...READ MORE

Sep 21, 2022 in Android by Edureka
• 13,620 points
244 views
0 votes
1 answer

How to open the Google Play Store directly from my Android application?

If you want to link to your ...READ MORE

answered Nov 7, 2022 in Android by Edureka
• 12,690 points
3,195 views
0 votes
0 answers

Google map not showing in android activity?

I want the MainActivity of my Android ...READ MORE

Nov 8, 2022 in Android by Edureka
• 13,620 points
1,618 views
0 votes
0 answers

Android Maps Library V2 zoom controls custom position

How can I arrange the built-in zoom ...READ MORE

Nov 22, 2022 in Android by Edureka
• 12,690 points
347 views
0 votes
0 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP