android - "Failed to load map" error contacting Google servers -
i have checked threads topic following advices , tutorials have same problem.
the strange thing have created sample project same configuration , it works! , works if change api key don't know if problem key or not.
manifest file:
<permission android:name="mypackage.permission.maps_receive" android:protectionlevel="signature"/> <uses-permission android:name="mypackage.permission.maps_receive"/> <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.write_external_storage"/> <uses-permission android:name="android.permission.access_wifi_state"/> <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="android.permission.access_network_state"/> <uses-permission android:name="android.permission.write_external_storage"/> <uses-sdk android:minsdkversion="10" android:targetsdkversion="10" /> <uses-feature android:glesversion="0x00020000" android:required="true"/>
inside application tag:
<meta-data android:name="com.google.android.maps.v2.api_key" android:value="my api key"/>
activity:
public class mapaactivity extends fragmentactivity{ private googlemap mmap; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.mapa); setupmapifneeded(); } @override protected void onresume() { super.onresume(); setupmapifneeded(); } private void setupmapifneeded() { if (mmap == null) { mmap = ((supportmapfragment) getsupportfragmentmanager().findfragmentbyid(r.id.map)).getmap(); if (mmap != null) { setupmap(); } } } private void setupmap() { mmap.addmarker(new markeroptions().position(new latlng(40, 12)).title("marker")); } }
are running both apps same keystore? api key should created along sha1 fingerprint , package name might missed logic.
Comments
Post a Comment