2017-02-18 125 views
2

我收到一個錯誤說更新谷歌服務從9.0.0到10.0.1 Android工作室2.2

錯誤:執行失敗的任務':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.

我試圖尋找https://bintray.com/android/android-tools/com.google.gms.google-services/和com.google.gms:谷歌服務:3.0.0似乎是最新的。這是我的gradle項目

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.3' 
     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 23 
    buildToolsVersion "23.0.1" 
    defaultConfig { 
     applicationId "sk.tipos.paradox02.citaj" 
     minSdkVersion 11 
     targetSdkVersion 23 
     versionCode 27 
     versionName '2.003' 
    } 


    buildTypes { 
     release { 
      minifyEnabled false 
      multiDexEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      // signingConfig signingConfigs.release 
     } 

     debug { 
      debuggable true 
      minifyEnabled false 
      multiDexEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt') 
//   signingConfig signingConfigs.release 
     } 
    } 


    productFlavors { 
    } 

    lintOptions { 

     checkReleaseBuilds false 

    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.google.gms:google-services:3.0.0' 
    compile 'com.android.support:appcompat-v7:23.1.0' 
    compile 'com.android.support:design:23.1.0' 
    compile 'com.google.android.gms:play-services:10.2.0' 
    compile 'com.google.android.gms:play-services-ads:10.2.0' 
    compile 'com.google.android.gms:play-services-appindexing:9.8.0' 
    compile 'com.google.android.gms:play-services-analytics:10.2.0' 

    compile 'com.google.firebase:firebase-core:9.0.0' 
    compile 'com.google.firebase:firebase-crash:10.0.1' 
    compile 'com.google.firebase:firebase-ads:10.0.1' 
    compile 'com.android.support:multidex:1.0.1' 
} 

應用插件: 'com.google.gms.google服務'

如果我改變播放服務到9.0.0一切都編譯好。我在這裏錯過了什麼?

你有沒有想過如何解決問題?

感謝

回答

1

您正在使用不同版本的dependencies.Update他們的版本,以配合最新的谷歌服務的版本版本。

例如

compile 'com.google.android.gms:play-services:10.2.0' 
compile 'com.google.android.gms:play-services-ads:10.2.0' 
compile 'com.google.android.gms:play-services-appindexing:10.2.0' 
compile 'com.google.android.gms:play-services-analytics:10.2.0' 
compile 'com.google.firebase:firebase-core:10.2.0' 
compile 'com.google.firebase:firebase-crash:10.2.0' 
compile 'com.google.firebase:firebase-ads:10.2.0' 
+0

沒有工作這:( – user7575308

+0

招這一行適用的插件:「com.google.gms.google服務」的gradle在文件末尾 –

+0

沒有..錯誤:執行失敗的任務「:應用程序:processDebugGoogleServices」 。 >請通過更新google-services插件的版本來修復版本衝突(有關最新版本的信息,請訪問https://bintray.com/android/android-tools/com.google.gms.google-服務/)或將com.google.android.gms的版本更新爲10.2.0。 – user7575308

2

你有這個問題,因爲火力地堡使用谷歌播放服務而建,所以你不能使用谷歌的Play版本比火力地堡的版本更高的服務。

你可以嘗試:

apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.1" defaultConfig { applicationId "sk.tipos.paradox02.citaj" minSdkVersion 11 targetSdkVersion 23 versionCode 27 versionName '2.003' } buildTypes { release { minifyEnabled false multiDexEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' // signingConfig signingConfigs.release } debug { debuggable true minifyEnabled false multiDexEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt') // signingConfig signingConfigs.release } } productFlavors { } lintOptions { checkReleaseBuilds false } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.google.gms:google-services:3.0.0' compile 'com.android.support:appcompat-v7:23.1.0' compile 'com.android.support:design:23.1.0' compile 'com.google.firebase:firebase-core:10.2.0' compile 'com.google.firebase:firebase-crash:10.2.0' compile 'com.google.firebase:firebase-ads:10.2.0' compile 'com.android.support:multidex:1.0.1' } apply plugin: 'com.google.gms.google-services'

對不起我的英語水平,希望它的幫助。

+0

@ user7575308請考慮接受答案,如果它wa這樣它就可以幫助其他人。 – Cochi

+0

no .. :( 錯誤:執行任務':app:processDebugGoogleServices'失敗。 >請通過更新google-services插件的版本來修復版本衝突(有關最新版本的信息可在https: //bintray.com/android/android-tools/com.google.gms.google-services/)或將com.google.android.gms的版本更新至10.2.0。 - 在您的代碼中缺少com.google.android.gms:play-services:.... – user7575308

+0

不,沒有缺失,不需要包含'com.google.android.gms:play-services'。 你有沒有嘗試沒有com.google.android.gms:play-services'?您也可以嘗試清理和重建該項目。 – Cochi

2

您是否嘗試過本帖中給出的解決方案:https://stackoverflow.com/a/37565535/3108709。我遇到了同樣的問題,這解決了我的問題。

That's because you should always put the "apply plugin" clause at the bottom for google-services, since it looks for the already-added dependencies. Do it like this in your app-level gradle:

dependencies { compile 'com.google.android.gms:play-services-ads:9.0.1' } // ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services'

This is hidden in the Firebase documentation, but applies even if you don't use Firebase.

Note : Update Google Repository also.

相關問題