Question

I am developing an Android application showing a map.

I'm using a MapFragment in which I display my map. I obtained an API Key and added all the needed permissions to my manifest.

So far so good, everything works fine when debugging the app on my HTC One S on Android 4.1.2 the map shows including controls and everything else.

When I debug the same application on my Galaxy S4 running Android 4.2.2, the map stays blank and only controls show.

Internet connection is definitely available.

  • Why is that the case?
  • Is there any difference between android 4.1 and 4.2 concerning the v2 Map API?
  • Is there any difference between Samsung and HTC concerning the issue?
  • Do I need a new key for some devices?

The "error message" I get on the Galaxy S4 is "Failed to load map. Could not contact google services."

Here is my manifest:

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="18" />

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<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="com.mypackage.permission.MAPS_RECEIVE"
    android:protectionLevel="signature"/>

<permission
    android:name="com.mypackage.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="myobtainedkey" />

Again: Everything works fine on my HTC One S, I'm looking for the reason why the map is not loading on the S4?

Things I already tried:

  • uninstall the app and reinstall it again
  • update / reinstall google play services
  • use wifi only / use data connection only
  • restart the device
  • clean the project
Was it helpful?

Solution 3

I have absolutely no idea why, but just yesterday it started to work. I made no changes to the application at all.

Probably it was just a network issue or google made some kind of upate on their google-services so that it now works.

OTHER TIPS

Try installing/updating google services on your Galaxy S4.

Please check date and time on your device. It seems like map is taking time stamp from the device. Map will only load if current time and device times are same

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top