【问题标题】:Google play-service plugin version conflict谷歌播放服务插件版本冲突
【发布时间】:2018-05-20 15:17:53
【问题描述】:

我只需要将 Firebase messenger 添加到我的项目中,现在我遇到了版本冲突。

我添加了错误消息和 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'

【问题讨论】:

    标签: android firebase google-play-services firebase-cloud-messaging


    【解决方案1】:

    我发现了问题。这有点愚蠢。

    这条线位于顶部底部

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

    关于如何使用这个插件的参考:https://developers.google.com/android/guides/google-services-plugin

    【讨论】:

      猜你喜欢
      • 2018-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-14
      相关资源
      最近更新 更多