android - Error :Execution failed for task ':app:processDebugGoogleServices' . > 请修复Android版本冲突

标签 android firebase google-play-services

我知道已经有很多类似的问题,但他们所有的解决方案都提到添加

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

在我拥有的 gradle 文件的底部。或者将 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:play-services:9.0.0 有效,但会与我完全无法使用的 Firebase 产生冲突。我正在尝试使用播放服务 9.4.0。

这是我的顶级构建 gradle 文件:

    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'

非常感谢。

最佳答案

试试这个:

删除

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

因为当您说:apply plugin: 'com.google.gms.google-services' 时,您包含了 Google Play 服务依赖项。 请告诉我是否有效。

关于android - Error :Execution failed for task ':app:processDebugGoogleServices' . > 请修复Android版本冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39616007/

相关文章:

android - 无需控制台即可在客户端访问 firebase/google 分析数据

android - Flutter Firebase和Android问题-无法初始化。找不到执行了最新(2020年9月)迁移说明的google-services.json

javascript - Android Eclipse 插页式广告因错误而未显示

android - Admob interstitial 在没有项目更改的情况下停止工作

android - 即使手机放在 table 上也会改变位置

android - Xamarin.Android中如何实现弹窗通知

ios - 注销后重新连接时 Firebase 会同步离线数据吗?

javascript - 在vuex中从firebase读取数据

Android:如何在 fragment 中创建带有 float RecyclerView 的叠加层

java - 重新连接套接字时重复接收消息