2016-11-29 50 views
0

我沒有找到我的答案。這是我的問題:錯誤,當我試圖添加依賴build.gradle

我想在我的應用程序中使用Google Sign-In。當我開始加入谷歌圖書館中,我得到這個錯誤:

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.

這是我gradle文件:

頂級級別:

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 
} 

應用級別:

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' 

如何解決我的錯誤?

+0

刪除'應用插件插件:「com.google.gms.google-服務'。您可以使用'10.0.0'版本 –

+0

然後'清理重建'並運行。希望這可以幫助您 –

回答

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

變化播放服務-auth的依賴如上面的代碼片段,並刪除在頂部即

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

它適用於我,非常感謝! – MyNameIs

+0

和butterknife,使用compile'c​​om.jakewharton:butterknife:7.0.1' –