【问题标题】:gradle sync failed with 1 warning Please fix the version conflict either by updating the version of the google-services plugin to 16.0.4gradle sync failed with 1 warning 请通过将 google-services 插件的版本更新为 16.0.4 来修复版本冲突
【发布时间】:2019-03-31 19:58:07
【问题描述】:

我尝试了所有可能的方法,但仍然无法同步,请帮忙。下面是我的整个 gradle 文件,我尝试合并 firebase 核心和消息传递,但它仍然显示错误

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })


    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-database:16.0.4'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
    implementation 'com.google.firebase:firebase-storage:16.0.4'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.firebaseui:firebase-ui-database:1.1.1'
    implementation 'id.zelory:compressor:2.1.0'
    implementation 'com.squareup.okhttp:okhttp:2.5.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.github.arturogutierrez:badges:1.0.5@aar'
    implementation 'com.github.broakenmedia:CharCountTextView:v1.0'
    implementation 'com.github.broakenmedia:MultiContactPicker:1.8.3'
    implementation 'com.github.lguipeng:BubbleView:1.0.1'
    implementation 'com.rockerhieu.emojicon:library:1.3.3'
    implementation 'com.android.support:cardview-v7:27.1.1'

}


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

下面是错误信息

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

【问题讨论】:

  • 请添加错误信息。
  • 我在下面添加了错误信息

标签: android firebase android-studio-3.0


【解决方案1】:

在您的 项目 build.gradle 文件中,替换为以下行:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        compile 'com.google.gms:google-services:4.2.0'//the latest version is 4.2.0

    }
}

【讨论】:

  • 不客气,您能接受或支持我的回答吗?谢谢!
【解决方案2】:

您正在使用不同版本的 firebase 依赖项。这可能是失败的原因。将 google-services 更新到最新版本,并为 firebase 依赖项使用相同版本..

// as you can see different versions for firebase dependecies
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-database:16.0.4'

使用 16.0.4 或最新版本的 firebase 依赖项。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多