SilverTear
SilverTear

Reputation: 733

App wont run unless you update google play services

Whenever I run my app in my emulator, which uses the Google maps API, I get the error "App wont run unless you update google play services". I've digged through some other questions about the same topic here on SO, since there are many, but I did not find a solution yet. So how do I get the Google maps API to work on my emulator?

When I go through installed apps on the emlator I don't see Google Play services in the list. So I am guessing this is the problem? If so, how do I get this on my device? Or isn't it possible at all on an emulator to use Google Play services?

I am using an emulator with Google API enabled.

Here is my Gradle build file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.thomas.app"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.facebook.android:facebook-android-sdk:4.6.0'
    compile 'com.android.support:support-v4:23.0.1'
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.android.support:design:23.0.1'
}

Upvotes: 3

Views: 3103

Answers (4)

michael
michael

Reputation: 2997

I had this same problem. I opened my emulator, went to Settings -> Apps -> Google Play services, and noted the version (in my case, 8.1.65). Then I opened my build.gradle and saw that the version there for com.google.android.gms:play-services was 8.3.0. I changed it to 8.1.0 and it worked on the emulator.

Upvotes: 2

IgorGanapolsky
IgorGanapolsky

Reputation: 26841

I got around this limitation of Android emulators by using Samsung's Device Test Lab - http://developer.samsung.com/remotetestlab. You can launch from a multitude of devices there, which all have Play Services.

Upvotes: 0

SilverTear
SilverTear

Reputation: 733

So There was no way to make Google play services run the default Android emulator shipped with the SDK . So instead I started to look into other emulators and found xamarin android player. I got Google play store and Google play services working on it in no time. So if anyone also has this issue, use this emulator instead. The only downside is you can't debug in it.

Upvotes: 1

A.Sanchez.SD
A.Sanchez.SD

Reputation: 2070

You might have to do a check in your code if the user has Google play services installed. If they dont, prompt them to download it from the play store.

Upvotes: 1

Related Questions