当前位置: 首页 > 知识库问答 >
问题:

Android-更新到API 28后生成错误(清单合并失败)[重复]

傅正豪
2023-03-14

我正在尝试使用最新的库作为我需求的一部分。我确实将gradle版本升级到了3.1。4和所有具有匹配编译和目标SDK版本的支持库,但在构建项目时

错误:清单合并失败:属性application@appComponentFactory值=(android.support.v4.app.CoreComponentFactory)来自[com.android.support: support-compat: 28.0.0]Androidanifest.xml:22: 18-91也存在于[androidx.core: core: 1.0.0]Android<-PLHD--5/>: 18-86 value=(androidx.core.app.CoreComponentFactory)。建议:添加工具:替换="android: appComponentFactory"的元素在Androidanifest.xml:28: 5-122:19覆盖。

我的应用程序构建。gradle看起来像这样:

buildscript {
repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
compileSdkVersion 28
defaultConfig {
    applicationId "propelit.actionopps.com.propelit"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 7
    versionName "1.7"
    multiDexEnabled true
    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
    useLibrary 'org.apache.http.legacy'

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
}
externalNativeBuild {

}
}
repositories {
mavenCentral()
mavenLocal()
flatDir {
    dirs 'libs'
}
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
implementation(name: 'HERE-sdk', ext: 'aar')
implementation 'com.victor:lib:1.0.4'
implementation 'com.google.code.gson:gson:2.8.5'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:preference-v14: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-annotations:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.github.markushi:circlebutton:1.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.android.support:multidex:1.0.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'

}

apply plugin: 'com.google.gms.google-services'

我的项目级构建。格雷德尔看起来像这样

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
    maven {
        url 'https://maven.fabric.io/public'
    }
    google()
    jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.4.1'
    classpath 'io.fabric.tools:gradle:1.29.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.google.gms:google-services:4.3.0'
}
}

allprojects {
repositories {
    google()
    jcenter()
    mavenCentral()
    mavenLocal()
    maven { url "https://jitpack.io"
    }
    maven {
        url 'https://maven.google.com/'
    }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

谁能告诉我我可能做错了什么?

共有1个答案

康锦
2023-03-14

因为我认为您正在使用新的AndroidX和旧的Android支持中的库,因为错误说明了AndroidX。果心应用程序。CoreComponentFactory和android。支持v4。应用程序。CoreComponentFactory,请在您的渐变中添加以下内容。属性

android.useAndroidX=true
android.enableJetifier=true

这应该可以解决这些依赖冲突。希望有帮助!

 类似资料:
  • 问题内容: 我正在将当前项目的大型应用程序移至Android Studio和Gradle中。我目前陷入以下问题: 我尝试将以下属性添加到主文件: 这些属性定义都不起作用。我究竟做错了什么? 问题答案: 试试看: 将此添加到 将此添加到 基于此,它应该覆盖所有元素。“将低优先级声明替换为带注释的声明。”

  • 我在移动我目前的项目巨大的应用程序到Android Studio和Gradle的过程中。我目前被困在以下问题上: 我尝试将以下属性添加到主文件中: 这些属性定义都不起作用。我做错了什么?

  • 我似乎得到了这样的错误:

  • 错误:清单合并失败:[com.android.support:support-compat:28.0.0]AndroidManifest.xml:22:18-91中的属性application@AppComponentFactory value=(Android.support.v4.app.CoreComponentFactory)也出现在[AndroidX.Core:Core:1.0.0]An

  • 明显合并失败,存在多个错误。查看日志: 错误:任务“:app:processDebugManifest”的执行失败。

  • 清单合并失败:属性Application@AppComponentFactory value=(android.support.v4.app.CoreComponentFactory)来自[com.android.support:support-compat:28.0.0]AndroidManifest.xml:22:18-91 也存在于[androidx.core:core:1.0.0]andr