This app won't run unless you update Google Play services error

I'm kind of lost right now. I'm implementing an Android application using Google maps.

In order to make it work I followed some tutorials which were pretty efficient. However I'm stuck with this ":

在这里输入图像描述

To fix, this problem I found some tricks here or here which tell that to solve this issue you have to take a special configuration for the emulator, here is mine:

在这里输入图像描述

and to install some .apk on the emulator.

在这里输入图像描述

And the magic is supposed to be done and the map is supposed to appear which is not my case.

I checked that my extras were well installed:

在这里输入图像描述

Here is my AndroidManifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="mypack"
          android:versionCode="1"
          android:versionName="1.0">

    <uses-sdk android:minSdkVersion="16"/>

    <permission android:name="mypack.permission.MAPS_RECEIVE"
                android:protectionLevel="signature"/>
    <uses-permission android:name="mypack.permission.MAPS_receive"/>

    <!-- Permission pour utiliser la connexion internet -->
    <uses-permission android:name="android.permission.INTERNET" />
    <!-- Permission permettant de vérifier l'état de la connexion -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!-- Permission pour stocker des données en cache de la map -->
    <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-feature
            android:glEsVersion="0x00020000"
            android:required="true" />

    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
        <meta-data
                android:name="com.google.android.maps.v2.API_KEY"
                android:value="MYKEY" />

        <meta-data android:name="com.google.android.gms.version"
                   android:value="@integer/google_play_services_version" />

        <activity android:name="Home"
                  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>

Here is my MainActivity

import android.app.Activity;
import android.os.Bundle;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;

public class Home extends Activity {
    /**
     * Called when the activity is first created.
     */
    private GoogleMap map;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
    }
}

and the corresponding layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
        >
    <fragment xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/map"
              android:name="com.google.android.gms.maps.MapFragment"
              android:layout_width="match_parent"
              android:layout_height="match_parent" />
</LinearLayout>

Hope to find some fix or what I missed here, thank you in advance.


In the Android SDK Manager, you must install "Google APIs (x86 System Image)" under "Android 4.4.2 (API 19)". Quit Eclipse and restart it.

Then create a new android virtual device in AVD manager and choose "Google APIs x86 (Google Inc.) - API Level 19" as target. Check "Use Host GPU" to ensure the drawing of the map will be accelerated.

That's it, this new emulator will have Play Services preinstalled and it will run faster because it's a x86 image.


using android studio, the only thing that helped me was to reduce the google play services version in the gradle file from the last version to this:

compile 'com.google.android.gms:play-services:4.2.+'

(ofcourse,this is a temporary "bypass" to enable you continue running)


I had a problem getting this error and hitting the 'Update' button did nothing, it was stuck on a loop, what worked is the following (in Android Studio):

  • Go to Tools > Android > SDK Manager
  • Check the 'Show Package Details' option
  • Under the Android version you want (7.1.1 for me right now), check Google Play Intel x86 Atom System Image 谷歌播放英特尔原子系统图像
  • Hit Apply/OK and let the image install
  • Now go to Tools > Android > AVD Manager
  • Create Virtual Device
  • Select one of the devices with a Google Play logo: 带有Google Play徽标的设备
  • Run your app in the new emulator. You can now hit 'Update' when you get the error, update Google Play Services via the Play Store on your device, and test your app in peace.
  • 链接地址: http://www.djcxy.com/p/90636.html

    上一篇: 将位置更新发送到IntentService

    下一篇: 除非您更新Google Play服务错误,否则此应用将无法运行