17

I have this problem with my emulator, i'm using API 5.1.1 and i have the lastest version of Google Play Services from SDK Manager.

AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

In the build.grable:

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

Raphael Teyssandier
  • 1,722
  • 2
  • 13
  • 25
  • I suspect you are confusing the Google Play Services SDK components with the companion application package they requires on the (emulated) device. It looks like the latter is what you are being prompted to update, from within the emulated device. – Chris Stratton Sep 30 '15 at 04:08

11 Answers11

23

Navigate to settings--> apps in your emulator and then find Google Play Services, check the version number and use it in you build.gradle

Hope this helps

vab
  • 723
  • 7
  • 15
  • You have right, my version on my emulator is 6.7.74. How to update it with the lastest version ? – Raphael Teyssandier Sep 30 '15 at 14:04
  • check this thread http://stackoverflow.com/questions/13691943/this-app-wont-run-unless-you-update-google-play-services-via-bazaar – vab Sep 30 '15 at 14:59
  • I have downgraded from compile 'com.google.android.gms:play-services:10.0.0' to compile 'com.google.android.gms:play-services:9.0.0' and this solved my problem. up +1 – Amir Nov 23 '16 at 16:06
  • my Emulator shows 10.2.98, but that doesn't seem to exist (gradle rejected it), but it works fine with downgrading to 9.0.0 (I had changed to 11.0.0) – Mairyu Jun 29 '17 at 03:17
  • When I downgrade my Google play service in my build.gradle, the neccessary methods and classes is not working – Olkunmustafa Apr 04 '18 at 12:18
3

Change the SDK in your emulator to v21 or lower. Physical devices are not effected by this issue.

The reason Android is complaining about an update for Google Play services is related to a known issue in Android emulators for API v22 and up (at this time 23). https://code.google.com/p/android/issues/detail?id=176348

You should try to use the latest version of Play Services in your build script as users are generally forced to have the latest version of this on their device.

Will Vanderhoef
  • 779
  • 7
  • 12
2

I downgraded the SDK from 5.1 to 5.0 and it's working.

Mohamed Salah
  • 868
  • 1
  • 15
  • 34
Raphael Teyssandier
  • 1,722
  • 2
  • 13
  • 25
2

This problem occurred when I start my application on emulator Android 5.1.1 (x86_64) - API 22. I have read some discussions about it, but no one from them helped me.

I tried to adjust version of Google Play Services in gradle build script (I mean you should update the script with "app" name). Don't forget to sync gradle when you update something in your script.

My gradle script "app" after updates:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"
    defaultConfig {
        applicationId "com.itmm.map"
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.google.android.gms:play-services:9.0.0'
    testCompile 'junit:junit:4.12'
}

Please, have a look into dependencies section. You're interesting in the follwoing line of script:

compile 'com.google.android.gms:play-services:9.0.0'

Currently, ver. 9.0.0 helps me and everything is ok. I can see MapActivity on Android emulator. 9.0.0 is not a newest version of Google Play Services (the newest is 9.6.1), but it works and it can solve your problem, if you aren't interestion in new features of ver. 9.6.1.

Amir
  • 8,821
  • 7
  • 44
  • 48
Dmitry
  • 276
  • 2
  • 4
  • I have downgraded from compile 'com.google.android.gms:play-services:10.0.0' to compile 'com.google.android.gms:play-services:9.0.0' and this solved my problem. up +1 – Amir Nov 23 '16 at 16:05
2
I had the same issue. But I followed the following things
1) First download the latest build tools and play services in Android SDK 
Android Studio -> Tools -> Android -> SDK Manager -> SDK Tools -> Android SDK Build Tools -> Install them 
& install Play Services by following same steps 

2) Create a new emaulator with latest api level for ex( API level : 28)

3) Run the app in the latest emulator 

It will work fine.
Jaya
  • 999
  • 11
  • 8
1

Your build.gradle has this line:

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

This means that android will use the latest version of Google Play Services when ever the app is run. The emulator might not have all the latest updates so the app will not run. Updating Google Play Services will help.

LonelyIdiot
  • 789
  • 2
  • 6
  • 16
1

Encountered the same problem on Android Studio 2.2. What I did was to go to SDK Manger -> Launch Standalone SDK Manager, uninstalled Broken Intel x86 Atom google_apis. Restarted Android Studio and ran the project, a popup asked Download System Image, hit OK to continue, the problem then went away.

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142
Dino Tw
  • 3,167
  • 4
  • 34
  • 48
1

My issue was resolved after logging in with an google account on the emulator. The 'update' button worked after that

Boy
  • 7,010
  • 4
  • 54
  • 68
1

Since I haven't seen any working solutions in 2020. There are two ways to fix this:

  1. Easy way is to create a new emulator with PlayStore Enabled. Check before downloading system image for the emulator.

  2. Hard way is to to install Google Play Store on the emulator manually and make the update button work. You can refer to the installation part here.

After that, the app will automatically update the Google Play Services in a few minutes. That's all.

Note: If that doesn't work, Go to Chrome -> Search for Google Play Services and open the playStore link of that app and update it there.

Sreekant Shenoy
  • 1,420
  • 14
  • 23
0

Check in your SDK settings if youve installed google play services: Android Studio--System Settings--Android SDK--SDK Tools:

Look for:Google Play Services and Google Play Licensing Library and make sure that both their status is:Installed.....if the above checklist is perfect,the next step you ought to perform is:

Open your build.gradle project level gradle and check that your gradle has:

classpath 'com.google.gms:google-services:3.1.0'

Then in your App level gradle: Under dependencies:

       dependencies{
     implementation 'com.google.android.gms:play-services-auth:11.8.0'
 and at the end of your gradle file:

    repositories {
    mavenCentral()
    apply plugin: 'com.google.gms.google-services'
}

Next

Click on the notification error you keep getting in your notification bar of your emulator and sign in with your google account(existing Email Address and password) Then try and run the app again...if you still get the error,click the notification error and try to sign in,,,keep trying until eventually the google playstore app will install and prompt you to update it. This is the simplest process,it requires a little bit of patience but evetually it works. Good Luck

RileyManda
  • 2,536
  • 25
  • 30
0

my emulator's Google Play services version is 12.6.85

so I changed the build.gradle like: implementation 'com.google.android.gms:play-services-maps:12.0.1'

Notes:

Dan Alboteanu
  • 9,404
  • 1
  • 52
  • 40