首页 > 解决方案 > 在 android studio 中为 FCM 实现 firebase 依赖项时出错

问题描述

我正在 android studio 中研究 FCM。在实现 firebase 依赖时,我遇到了一些错误。请解决我的问题。谢谢你 :)

implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.android.gms:play-services-plus:16.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.android.gms:play-services-location:16.0.0'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-messaging:9.2.0'
// implementation 'com.google.firebase:firebase-messaging:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.2'

我得到这样的错误

错误:清单合并失败:来自 [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 的属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) 也是出现在 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory)。建议:将 'tools:replace="android:appComponentFactory"' 添加到 AndroidManifest.xml:11:5-52:19 的元素以覆盖。

标签: androidfirebasedependenciesfirebase-cloud-messagingaccess-token

解决方案


对我来说更新版本号有效。在这里查看最新版本:https ://firebase.google.com/support/release-notes/android

例如:

com.google.firebase:firebase-messaging:19.0.1

推荐阅读