添加材料设计支持后,清单合并失败并出现多个错误 [英] Manifest merger failed with multiple errors after adding material design support

查看:98
本文介绍了添加材料设计支持后,清单合并失败并出现多个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序之前运行良好,但是最近在android pie更新之后,我将targetSDKVersion更改为28,并添加了材料设计支持,并得到了此错误.

My application was working fine before but recently after android pie update I have changed the targetSDKVersion to 28 and added material design support and got this error.

清单合并失败:属性application @ appComponentFactory 值=(android.support.v4.app.CoreComponentFactory)来自 [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91也存在于 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 值=(androidx.core.app.CoreComponentFactory).意见建议:添加 'tools:replace ="android:appComponentFactory"'转换为元素 在AndroidManifest.xml:7:5-53:19进行覆盖.

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 element at AndroidManifest.xml:7:5-53:19 to override.

我已经更新了所有库并尝试了它给我的所有建议,但仍然无法确定程序.下面是我添加的依赖项.

I have updated all the libraries and tried all the suggestions that it gave me but still, I cannot figure out the program. Below are the dependencies that I have added.

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-compat:28.0.0'
implementation 'com.android.support:mediarouter-v7:28.0.0'
implementation 'com.android.support:support-annotations: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 'com.facebook.android:facebook-android-sdk:[4,5)'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation "com.android.support:support-core-utils:28.0.0"
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation group: 'com.android.support', name: 'customtabs', version: '28.0.0'
}

推荐答案

它说您的support依赖项与androidx.core依赖项冲突

it says your support dependency has conflict with androidx.core dependency

android studio不能同时将android x依赖项与以前的support依赖项一起使用.您应该只使用其中之一.

the android studio cannot use android x dependencies with previous support dependencies at the same time. you should just use one of them.

使用这些依赖项

implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'

使用此链接重构您的依赖关系 https://developer.android.com/topic/libraries/support-library/重构

use this link to refactor your dependencies https://developer.android.com/topic/libraries/support-library/refactor

这篇关于添加材料设计支持后,清单合并失败并出现多个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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