I'm working on using the google maps api for an android application but I keep on getting the "App won't run unless you update the google play services" error.
I recently installed the latest version of google play services maps (version I believe 10.2.99)
by adding the line
compile 'com.google.android.gms:play-services-maps:10.2.99'
to my gradle build file dependencies and clicking on the "Install repository and sync project" seen in the message window which prompted the download.
I apparently needed to install the version being used on my emulator device which is version 9.8.79 (because that's the version running on the emulator device)
So far: I've tried updating the gradle dependencies to
compile 'com.google.android.gms:play-services-maps:9.8.79'
But the "Install repository and sync project" button wont register a click and I haven't been able to resolve the dependency that way
I've tried downloading a new sdk to see if that would change the google play services version number I need
and
I've tried to import the module by downloading the library but http://www.apkmirror.com/uploads/?q=google-play-services doesn't have that version of the play services library.
I'm officially stuck and would love any help
edit
I tried setting the line to
compile 'com.google.android.gms:play-services-maps:+
and no dice
I also tried updating sdk for my play services right before this post and that also didnt help
here is my gradle build
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "teamplaceholder.com.placeholderapp"
minSdkVersion 23
targetSdkVersion 25
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(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:cardview-v7:25.1.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta5'
compile 'com.android.support:cardview-v7:25.1.1'
compile 'com.google.android.gms:play-services-maps:9.8.79'
testCompile 'junit:junit:4.12'
}
I was able to fix the error by updating the play services for the emulator as Alvi and Ahamed suggested by downloading a Nexus 5 x86_64 and API 24 emulator and using that(emulator suggested in How to update Google Play Services for Android Studio 2.2 emulators?). I also needed to clear the play services cash once I ran the emulator by going into settings->storage->apps->GooglePlayServices and pressing "clear cash"
Thanks a ton for all the help