2016-09-21 69 views
1

我知道有很多類似的問題了,但他們所有的解決方案提在gradle這個文件的底部,這是我加入錯誤:執行任務':app:processDebugGoogleServices'失敗。 >請修正版本衝突的Android

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

。或者更新google-services到3.0.0,我也有。

的錯誤是:

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] 
Error:Execution failed for task ':app:processDebugGoogleServices'. 
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. 
Information:BUILD FAILED 

回滾到com.google.android.gms:發揮服務:9.0.0作品,但創建了火力地堡這我完全無法使用衝突。我正在嘗試使用play-services 9.4.0。

這裏是我的頂層構建graddle文件:

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.0' 
     classpath 'com.google.gms:google-services:3.0.0' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

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

這裏是我的應用程序級gradle這個文件:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 24 
    buildToolsVersion '24.0.2' 
    defaultConfig { 
     applicationId "com.studio08.ronen.Zivug" 
     minSdkVersion 16 
     targetSdkVersion 24 
     multiDexEnabled true 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
//  debug { 
//   debuggable true 
//  } 
    } 
} 

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' 
    }) 
    // third-parties 
    // https://github.com/lopspower/CircularImageView 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.mikhaellopez:circularimageview:3.0.2' 
    // material design and appcompat 
    compile 'com.android.support:appcompat-v7:24.2.1' 
    compile 'com.android.support:design:24.2.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4' 
    compile 'com.android.support:support-v4:24.2.1' 
    compile 'com.android.support:palette-v7:24.2.1' 
    compile 'com.android.support:cardview-v7:24.2.1' 
    // google 
    compile 'com.google.firebase:firebase-core:9.0.0' 
    compile 'com.firebaseui:firebase-ui:0.5.3' 
    compile 'com.google.firebase:firebase-auth:9.4.0' 
    // compile 'com.google.android.gms:play-services-maps:9.4.0' 
    // compile 'com.google.android.gms:play-services:9.4.0' 
    testCompile 'junit:junit:4.12' 
    compile 'com.google.android.gms:play-services:9.4.0' 


} 

// ADD THIS AT THE BOTTOM 
apply plugin: 'com.google.gms.google-services' 

非常感謝你。

回答

2

試試這個:

刪除

compile 'com.google.android.gms:play-services:9.4.0' 

因爲當你說:應用插件: 'com.google.gms.google服務' 你是包括谷歌播放服務的依賴。 請告訴我,如果工程請。

+0

謝謝你這個工作,我沒有看到在文檔中的任何地方。 – Ronen

2

更改火力核心版本

compile 'com.google.firebase:firebase-core:9.4.0' 
compile 'com.google.firebase:firebase-auth:9.4.0' 

刪除

compile 'com.google.android.gms:play-services:9.4.0' 
+0

謝謝你這個工作。我沒有看到Firebase沒有更新。 – Ronen

1

如果使用classpath中任何人的com.google.gms:谷歌服務:3.1.0'

剛將版本降低到3.0.0(不知道原因)。但工作

classpath 'com.google.gms:google-services:3.0.0' 
相關問題