分享

android – Manifest合并失败:属性应用程序@ appComponentFactory

 印度阿三17 2019-06-07

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

implementation 'com.wdullaer:materialdatetimepicker:4.0.1'

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

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.

即使我在我的Manifest中添加了这个建议

<?xml version="1.0" encoding="utf-8"?>
   <manifest xmlns:android="http://schemas./apk/res/android"    
   xmlns:tools="http://schemas./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...

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

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和其他的块代码在内的工作,但没有成功.我卡住了

或者甚至可以赞赏具有材料设计的DatePicker库的另一个推荐

编辑 – 解决方案:
感谢所有btw
所以降级库是好的,但后来它给了我这个错误

Error about different versions support(由于我的水平我不能直接说,对不起)

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

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

然后我就可以毫无错误地使用该库

再次感谢所有人!

解决方法:

日期选择器将androidx作为依赖项.降级到版本3.6.4将使它再次依赖于android.support – 或升级您的应用程序以使用androidx.见issue 543.

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

^这将是修复冲突依赖项的最简单方法.

来源:http://www./content-1-228651.html

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多