MyNameIs MyNameIs - 6 days ago 15
Android Question

Error when I tried to add dependency to build.gradle

I didn't find answer for me. This is my problem:

I want to use

Google Sign-In
in my app. When I started to add google library I got this error:

Error:Execution failed for task ':app:processBetaGoogleServices'.



Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.


This is my
gradle
files:

Top level:

buildscript {
repositories {
jcenter()
mavenLocal()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.0.0'
}
}

allprojects {
repositories {
jcenter()
mavenLocal()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}


App level:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.google.android.gms:play-services-auth:10.0.1'
}

apply plugin: 'com.google.gms.google-services'


How to fix my error?

Answer
compile 'com.google.android.gms:play-services-auth:9.2.0'

change the play-services-auth dependency as above code snippet,and remove the plugin at the top i.e.

apply plugin: 'com.google.gms.google-services'
Comments