【问题标题】:How to fix "Please fix the version conflict either by updating the version of the google-services plugin"如何解决“请通过更新 google-services 插件的版本来解决版本冲突”
【发布时间】:2017-07-01 16:54:43
【问题描述】:

我使用的是 Android Studio 2.3.3。我尝试在我的应用中使用 Firebase 实时身份验证,但出现此错误:

错误:任务 ':app:processDebugGoogleServices' 执行失败。

请通过更新 google-services 插件的版本(有关最新版本的信息可在 https://bintray.com/android/android-tools/com.google.gms.google-services/ 获得)或将 com.google.android.gms 的版本更新到 10.2.0 来解决版本冲突。

我的项目毕业:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

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

我的模块毕业:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '26.0.0'
    defaultConfig {
        applicationId "com.ccnstudent.hridoychandradas.ccnapp"
        minSdkVersion 17
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

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

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'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-auth:10.2.0'
    compile 'com.google.android.gms:play-services-auth:11.0.2'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.google.firebase:firebase-database:10.0.1'
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services:11.0.2'
}

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

【问题讨论】:

标签: android firebase


【解决方案1】:

我认为您应该检查您的 google-services.json 文件的拼写。如果没有,请右键单击该文件选择重构 -> 到 google-services.json

【讨论】:

  • 编译“com.google.android.gms:play-services-location:9.2.0”
  • 11.0.2 不是 9.2.0
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-15
  • 1970-01-01
相关资源
最近更新 更多