清单合并失败:属性application @ appComponentFactory [英] Manifest merger failed: Attribute application@appComponentFactory

查看:439
本文介绍了清单合并失败:属性application @ appComponentFactory的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很好,但我正在尝试添加此库 https://github.com/wdullaer/MaterialDateTimePicker

So all good but I'm trying to add this library https://github.com/wdullaer/MaterialDateTimePicker with this

implementation 'com.wdullaer:materialdatetimepicker:4.0.1'

突然,当我同步我的Graddle时,它给了我这个错误

And suddenly when I sync my Graddle it give me this 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:10:5-53:19 to override.

即使我在清单中添加了该建议

And even if I add that suggestion in my Manifest

<?xml version="1.0" encoding="utf-8"?>
   <manifest xmlns:android="http://schemas.android.com/apk/res/android"    
   xmlns:tools="http://schemas.android.com/tools"
   package="com.itt.ceatm">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:replace="android:appComponentFactory"> // HERE
    <activity...

我无法完成它,因为现在我收到了这个错误

Im not able to get it done because now I get this error

Manifest merger failed with multiple errors, see logs

这是我完整的清单

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.itt.ceatm"
    minSdkVersion 19
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
    android.defaultConfig.vectorDrawables.useSupportLibrary = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
 }
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.mikhaellopez:circularimageview:3.2.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.github.ganfra:material-spinner:2.0.0'

implementation 'com.wdullaer:materialdatetimepicker:4.0.1' //NEW LIBRARY

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'}

有什么建议吗?我已经进行了研究,试图围绕包括configureall和其他模块的代码进行工作,但没有成功.我卡住了

Any advices? I already do a research, trying to do work arround including the block code of configureall and others but no success. Im stuck

或者对带有材料设计的DatePicker库的另一种推荐将不胜感激

Or even another recomendation of a library for DatePicker with material design would be appreciated

编辑-解决方案: 感谢所有顺便说一句 因此,降级库是可以的,但是随后却给了我这个错误

EDIT - SOLUTION: Thanks to all btw So downgrading the library was ok but then it gave me this error

关于不同版本支持的错误(由于我的级别,抱歉)

Error about different versions support (I can't put it directly due to my level, sorry)

然后我进行了研究,并添加了这两个新的实现

Then I did a research and added this new 2 implementations

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-vector-drawable:28.0.0'

implementation 'com.android.support:support-v13:28.0.0' //THIS
implementation 'com.android.support:support-media-compat:28.0.0' //AND THIS

implementation 'com.mikhaellopez:circularimageview:3.2.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.github.ganfra:material-spinner:2.0.0'

implementation "com.wdullaer:materialdatetimepicker:3.6.4"

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'}

然后我就可以使用该库而不会出现错误

And then I was able to use the library without errors

再次感谢大家!

推荐答案

日期选择器具有androidx作为依赖项.降级到版本3.6.4将使其再次依赖android.support-或升级您的应用程序以使用androidx.参见问题543 .

the date-picker has androidx as a dependency. downgrading to version 3.6.4 would make it depend on android.support again - or upgrade your app to use androidx. see issue 543.

// https://mvnrepository.com/artifact/com.wdullaer/materialdatetimepicker
implementation "com.wdullaer:materialdatetimepicker:3.6.4"

^这将是解决冲突依赖关系的最简单方法.

^ this would be the most easy way to fix the conflicting dependencies.

这篇关于清单合并失败:属性application @ appComponentFactory的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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