Qas Qas - 6 months ago 309
Android Question

Android Studio: Failed to resolve: com.google.android.gms:play-services:fp9.0.0

When I try to compile I get this error
"Failed to resolve: com.google.android.gms:play-services:fp9.0.0" in Android Studio. I am trying to include the play services in my project. This is my build.gradle file:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "Application name"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.google.android.gms:play-services:fp9.0.0'
}


The only thing I have changed in this file is this line:

compile 'com.google.android.gms:play-services:fp9.0.0'


I have installed Google Play Services and it's version number is 30.

Answer

I had the same issue yesterday. In the messages section when running a gradle sync or build, I got a message with an option to update something from the M2 repo. Clicking the link downloaded the latest version and fixed the issue.

You could also try compile 'com.google.android.gms:play-services:9.0.0'

If you are only using maps, consider only downloading maps using compile 'com.google.android.gms:play-services-maps:9.0.0' as it can save you hitting the 65K method dex limit later in development.

Comments