Конфликт версий плагина Google play-service - PullRequest
0 голосов
/ 20 мая 2018

Мне просто нужно было добавить мессенджер Firebase в мой проект, и теперь я получаю конфликты версий.

Я добавил сообщение об ошибке и содержимое файлов Gradle.

Я не вижу, что нужноизменилось, но перед тем, как начать его добавлять - все было хорошо.

Сообщение об ошибке: «Пожалуйста, исправьте конфликт версий, либо обновив версию плагина google-services (информация о последней версии доступна на https://bintray.com/android/android-tools/com.google.gms.google-services/) или обновление версии com.google.android.gms до 11.4.2. "

Gradle (сборка)

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

buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.1'
        classpath 'io.fabric.tools:gradle:1.25.1'
        classpath 'com.google.firebase:firebase-plugins:1.1.5'

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

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

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

Gradle (приложение)

    apply plugin: 'com.android.application'
    apply plugin: 'com.google.firebase.firebase-perf'
    apply plugin: 'io.fabric'
    apply plugin: 'com.google.gms.google-services'

    android {
        compileSdkVersion 26
        buildToolsVersion '27.0.3'

        defaultConfig {
            applicationId "XXXXXXXX"
            minSdkVersion 16
            targetSdkVersion 26
            versionCode 1
            versionName "1.0"
            vectorDrawables.useSupportLibrary = true
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        implementation 'com.android.support:support-v4:26.1.0'
        implementation 'com.android.support:support-vector-drawable:26.1.0'
        implementation 'com.android.support.constraint:constraint-layout:1.1.0'
        implementation 'com.google.firebase:firebase-perf:11.8.0'
    //    implementation 'com.google.firebase:firebase-auth:11.8.0'

        compile fileTree(include: ['*.jar'], dir: 'libs')
        testCompile 'junit:junit:4.12'

        compile 'com.android.support:appcompat-v7:26.1.0'
        compile 'com.android.support:design:26.1.0'
        compile 'com.google.firebase:firebase-core:11.8.0'
        compile 'com.google.firebase:firebase-database:11.8.0'
        compile 'com.firebaseui:firebase-ui:3.2.2'
        compile 'com.google.firebase:firebase-messaging:11.8.0'
        compile 'com.crashlytics.sdk.android:crashlytics:2.9.1'

        annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
    }

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

1 Ответ

0 голосов
/ 20 мая 2018

Я нашел проблему.Это было довольно глупо.

Эта строка была сверху и снизу

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

Для справки о том, как использовать этот плагин: https://developers.google.com/android/guides/google-services-plugin

...