【问题标题】:Manifest merger failed for V7V7 的清单合并失败
【发布时间】:2019-12-26 11:37:04
【问题描述】:

我更新了一些东西,突然发生了这种情况

错误:清单合并失败:属性 应用程序@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-57:19 覆盖。

我已经查看了其他答案,但我无法真正弄清楚要做什么或要改变什么

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
    applicationId "com.example.khali.nutriplan"
    minSdkVersion 22
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'
implementation 'com.numetriclabz.numandroidcharts:numandroidcharts:1.0.18'
implementation 'com.xeoh.android:checkboxgroup:1.0.1'
implementation 'com.jjoe64:graphview:4.2.2'
implementation 'androidx.fragment:fragment:1.0.0'
}

什么是合适的库使用

【问题讨论】:

标签: android gradle android-manifest android-support-library androidx


【解决方案1】:

这里提到

https://github.com/material-components/material-components-android/issues/193#issuecomment-486932223

gradle.properties文件中添加两行:

android.useAndroidX=true
android.enableJetifier=true

【讨论】:

    【解决方案2】:

    你正在使用支持库和安卓库,你不能这样做。

    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'androidx.fragment:fragment:1.0.0'
    

    您必须迁移到 Androidx

    • com.android.tools.build:gradle 升级到 v3.2.1 或更高版本。
    • compileSdkVersion 升级到28 或更高版本。
    • 更新您的应用以使用 Jetpack (AndroidX);按照Migrating to AndroidX 中的说明进行操作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多