i am trying to implement google maps in my android application but i am stuck on an error
"android Failed to load map. Could not contact Google servers
."
i have included google play library, got the key using SHA1 certificate fingerprint.
i got the SHA1 certificate fingerprint as :
sudo keytool -v -list -alias androiddebugkey \-keystore /home/.android/debug.keystore
i managed my manifest file according to This
now i am unable to find the cause of this error.. any suggestion is greatly appreciated...
EDIT: my manifest file permissions are as:
<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 layout xml have fragment as:
<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.
Clear the app's cache & data On your Android phone or tablet, open the Settings app . Tap Apps & notifications. Follow the steps on your device to find the Maps app. After you select the app, storage & cache options should be available.
Are you sure you have enabled "Google Maps Android API v2" and not "Google Maps API v2"? After changing that, delete and recreate the API key. This worked for me...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With