Android:添加Firebase消息传递-合并合并失败 [英] Android: Adding Firebase Messaging - Menifest merger failed

查看:84
本文介绍了Android:添加Firebase消息传递-合并合并失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将此添加到了我的项目中:

I added this to my project:

implementation 'com.google.firebase:firebase-messaging:19.0.0'

和结果:

ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:15:5-71:19 to override.

所以我继续将那行添加到清单中,我得到了:

So I go went ahead and added that line to the manifest, and I get this:

 Manifest merger failed with multiple errors, see logs

我去合并错误,现在我看到了:

I went to merging errors, and I see this now:

Error: tools:replace specified at line:15 for attribute android:appComponentFactory, but no new value specified app main manifest (this file), line 14

这是我当前的gradle依赖项:

Here are my current gradle dependencies:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation project(path: ':bluefire-api-v25.5')
    implementation "com.jakewharton:butterknife:8.5.1"
    annotationProcessor "com.jakewharton:butterknife-compiler:8.8.1"
    implementation 'com.myhexaville:smart-image-picker:1.0.4'
    implementation 'com.github.gcacace:signature-pad:1.2.1'

    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

    implementation 'com.android.support:recyclerview-v7:28.0.0'

    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.firebase:firebase-messaging:19.0.0'
}

我死胡同了.有想法吗?

I hit a dead-end. Thoughts?

推荐答案

由于同时存在supportandoidx库,因此出现此问题.

This Issue occur due to support and andoidx library both present.

检查 Firebase发行说明.

此版本是主要版本更新,其中包含重大更改. 在此版本中,库已从Android支持迁移 Jetpack(AndroidX)库的库.更新的库 除非您在应用中进行以下更改,否则它将无法正常工作: 将com.android.tools.build:gradle升级到v3.2.1或更高版本.升级 compileSdkVersion到28或更高版本.更新您的应用程序以使用Jetpack (AndroidX);请按照迁移到AndroidX中的说明进行操作.

This release is a MAJOR version update and includes breaking changes. With this release, libraries are migrated from the Android Support Libraries to the Jetpack (AndroidX) Libraries. The updated libraries will not work unless you make the following changes in your app: Upgrade com.android.tools.build:gradle to v3.2.1 or later. Upgrade compileSdkVersion to 28 or later. Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.

如果在gradle中使用了支持版本,则将firebase版本降低到18.0.0.否则,您需要迁移到androidx.

If you have used support version in your gradle, than down firebase version to 18.0.0. Otherwise you need to migrate to androidx.

这篇关于Android:添加Firebase消息传递-合并合并失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆