android - V7 的 list 合并失败

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

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

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

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

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

什么是合适的库

最佳答案

你正在使用支持库和androix库,你做不到。

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 中的说明进行操作.

关于android - V7 的 list 合并失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57587415/

相关文章:

android - 非法反射访问操作

gradle - 在配置阶段未执行Gradle任务(类型:Exec)

java - Eclipse Gradle 项目未找到 JUnit 测试

android - 在 RINGING 电话状态下关闭 wifi

android - MapActivity 错误 : force close

java - Android 套接字流

android - 对话框的标题太高

Android 应用标签名称无处不在

android - 找不到 Google Awareness API

Android通过处理程序在单独的线程上更新TextView