Google Maps for Android. Failed to load map. Could not contact Google servers -
i'm trying work google maps on android should appear map white , error: failed load map. error contacting google servers. i've followed many tutorials , answers related on problem still can't fix it. think have correct api key (google maps android) , permissions, perhaps forget , me. android version 4.1.1. lot.
the androidmanifest.xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.mapmap" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="11" android:targetsdkversion="17"/> <uses-feature android:glesversion="0x00020000" android:required="true"/> <permission android:name="com.example.mapmap.permission.maps_receive" android:protectionlevel="signature"/> <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-permission android:name="com.android.vending.check_license" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <meta-data android:name="com.google.android.maps.v2.api_key" android:value="key_from_google_console"/> <activity android:name="com.example.mapmap.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> </application> </manifest>
the activity_main.xml:
<fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.mapfragment"/>
the mainactivity.java:
package com.example.mapmap; import android.os.bundle; import android.app.activity; import android.view.menu; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } }
try using
com.google.android.gms.maps.supportmapfragment
instead of
com.google.android.gms.maps.mapfragment
Comments
Post a Comment