Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Map API v2 not showing Map on some Devices

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
like image 777
Philipp Jahoda Avatar asked Aug 01 '13 15:08

Philipp Jahoda


People also ask

Is Google Maps API no longer free?

Note that the Maps Embed API, Maps SDK for Android, and Maps SDK for iOS currently have no usage limits and are at no charge (usage of the API or SDKs is not applied against your $200 monthly credit).

What is the best free map API?

Mapbox is probably the most popular Google Maps API alternative developers and businesses use. They have been in business since 2010 and started as a free map data and analysis service for non-profit organizations. Today, they provide map tools and data to players like Facebook, Lonely Planet, and Foursquare.


1 Answers

Try installing/updating google services on your Galaxy S4.

like image 79
Ritesh Avatar answered Sep 19 '22 22:09

Ritesh