Note that there are some explanatory texts on larger screens.

plurals
  1. POFailed to load map. Error contacting Google servers issue with android google maps api v2
    text
    copied!<p>I have been trying to app a Google Map in my Android app using the v2 API for the past two days, with no success. All I get every time is a </p> <p><code>Google Maps Android API(16603): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).</code></p> <p>I have followed Google's setup tutorial (<a href="https://developers.google.com/maps/documentation/android/start" rel="noreferrer">https://developers.google.com/maps/documentation/android/start</a>), tried multiple times with different projects in different workspaces, tried different Google accounts, gone through various answers and suggestions here in StackOverflow, but to no avail.</p> <p>I am using Eclipse 4.2.2 with Android SDK Tools 22.01 and I have installed Google Play services (rev. 7), also I have imported <code>google-play-services_lib</code> into my workspace and added a reference to that to my android project.</p> <p>Here is my code:</p> <p><code>AndroidManifest.xml:</code></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.googlemapdemo" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /&gt; &lt;permission android:name="com.example.googlemapdemo.permission.MAPS_RECEIVE" android:protectionLevel="signature" /&gt; &lt;uses-permission android:name="com.example.googlemapdemo.permission.MAPS_RECEIVE"/&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;uses-feature android:glEsVersion="0x00020000" android:required="true"/&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name="com.example.googlemapdemo.MainActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="my_api_key" /&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p><code>activity_main.xml:</code></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;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" /&gt; </code></pre> <p><code>MainActivity.java</code></p> <pre><code>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; } } </code></pre> <p>Also I created an API Project on <a href="https://code.google.com/apis/console/" rel="noreferrer">https://code.google.com/apis/console/</a> where I have enabled the <code>Google Maps Android API v2</code> service. Then I obtained my SHA1 debug certificate fingerprint using </p> <pre><code>keytool -list -v -keystore "C:\Users\my_user_name\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android </code></pre> <p>and entered that and the package name in the API console, got the API key and put it in the manifest (where <code>my_api_key</code> is). This procedure I repeated a number of times, regenerating the key but with the same result.</p> <p>Could anyone help with this or suggest anything else I could try? Any help will be greatly appreciated!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload