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:
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
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.
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.
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.
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