首页 > 解决方案 > FCM Gradle 更新

问题描述

我无法更新

com.google.firebase:firebase-messaging:11.0.4

 com.google.firebase:firebase-messaging:17.3.3

11.0.4 工作正常。类路径 'com.google.gms:google-services:4.1.0' 也添加到我的依赖项中。

我的 Gradle 代码

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    implementation files('libs/volley.jar')
    implementation 'jp.wasabeef:recyclerview-animators:2.2.6'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    implementation 'com.android.support:multidex:1.0.1'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.google.apis:google-api-services-youtube:v3-rev181-1.22.0'
    implementation 'com.google.firebase:firebase-core:16.0.3'
    implementation 'com.google.firebase:firebase-messaging:17.3.3'
    //implementation 'com.google.firebase:firebase-ads:11.0.4'
    implementation 'com.google.android.gms:play-services-maps:11.0.4'
    implementation 'com.google.android.gms:play-services-location:11.0.4'
    implementation 'com.squareup.retrofit2:retrofit:2.1.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
    implementation 'com.google.code.gson:gson:2.7'
    implementation 'com.squareup:otto:1.3.8'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    implementation 'com.jsibbold:zoomage:1.1.0'
}
apply plugin: 'com.google.gms.google-services'

标签: androidfirebaseandroid-gradle-pluginfirebase-cloud-messaging

解决方案


更新 Google Play 服务库:

implementation "com.google.firebase:firebase-core:16.0.3"
implementation "com.google.firebase:firebase-messaging:17.3.2"
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.android.gms:play-services-maps:15.0.1"
implementation "com.google.android.gms:play-services-location:15.0.1"

因为11.0.4版本会导致冲突。


推荐阅读