插件的版本来解决版本冲突

插件的版本来解决版本冲突

本文介绍了错误:请通过更新 google-services 插件的版本来解决版本冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Google 服务插件时遇到问题.

I'm having a problem with Google Services plugin.

我将谷歌服务更新到最新版本.我从这个网站得到了一个依赖:https://bintray.com/android/android-tools/com.google.gms.google-services/

I updated google services to the latest version. I got a dependency from this site: https://bintray.com/android/android-tools/com.google.gms.google-services/

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 11.2.0.

这是我的 Gradle 文件:

This are my Gradle files:

应用中的那个:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "********"
        minSdkVersion 23
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile('com.mikepenz:materialdrawer:5.2.0@aar') {
        transitive = true
    }

    compile(name: 'toolkit', ext: 'aar')

    compile 'com.google.firebase:firebase-database:11.2.0'
    compile 'com.facebook.android:facebook-android-sdk:[4,5)'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
    compile 'com.jakewharton:butterknife:8.7.0'
    compile 'uk.co.chrisjenx:calligraphy:2.3.0'
    compile 'com.jmedeisis:draglinearlayout:1.1.0'
    compile 'com.google.firebase:firebase-auth:11.4.2'
    compile 'com.google.gms:google-services:3.1.1'
    compile 'com.firebase:firebase-client-android:2.5.2'
    compile 'com.google.firebase:firebase-storage:11.2.0'
    compile 'com.android.support:design:25.3.1'
    compile 'com.itextpdf:itext-pdfa:5.5.10'
    compile 'com.itextpdf:itextg:5.5.9'
    compile 'com.mikepenz:google-material-typeface:2.2.0.1@aar'
    compile 'com.mikepenz:fontawesome-typeface:4.4.0.1@aar'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.mikepenz:itemanimators:0.2.4@aar'
    compile 'com.android.support:support-v4:25.3.1'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
}

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

项目中的一个:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.1.0'

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

allprojects {
    repositories {
        jcenter()
        flatDir {
            dirs 'libs'
        }
        maven {
            url "https://maven.google.com"
        }
    }
}

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

推荐答案

使用相同版本的 firebase 和 Google play 服务

Use the same version of firebase and Google play services

compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-storage:11.4.2'

//Remove this dependency
//compile 'com.google.gms:google-services:3.1.1'

//Add this dependency if you need Google play services
compile 'com.google.android.gms:play-services:11.4.2'

这篇关于错误:请通过更新 google-services 插件的版本来解决版本冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 12:30