I am trying to implement google maps in my Android application, but I am stuck with the error " android Failed to load map. Could not contact Google servers." I turned on the google game library, got the key using the SHA1 certificate thumbprint. I received the SHA1 certificate fingerprint as:
sudo keytool -v -list -alias androiddebugkey \-keystore /home/.android/debug.keystore
I managed the manifest file according to This
now I can not find the cause of this error .. any suggestion is much appreciated ...
- I saw stackoverflow questions but got no solution!
EDIT : my manifest file permissions are as follows:
<permission
android:name="PAKG_NAME.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="PAKG_NAME.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
.....................
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MY_KEY" />
and my xml layout has a snippet like:
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
class="com.google.android.gms.maps.SupportMapFragment" />
Logcat Output:
E/Google Maps Android API(31478): Failed to load map. Could not contact Google servers.
source
share