Android未能合并清单文件

问题描述 投票:0回答:2

我也知道这类问题,但我的问题并未通过这些答案解决。今天,我在我的应用程序中添加了新版本的PayU Money,突然显示错误。我已将整个项目转换为androidx,出现同样的错误。

清单合并失败:[androidx.core:core:1.0.0]的属性application @ appComponentFactory value =(androidx.core.app.CoreComponentFactory)来自AndroidManifest.xml:22:18-86也出现在[com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value =(android.support.v4.app.CoreComponentFactory)。建议:在AndroidManifest.xml:31:5-163:19的元素上添加'tools:replace =“ android:appComponentFactory”'以进行覆盖。

如果我在清单文件中添加此tools:replace =“ android:appComponentFactory,则会显示新错误

清单合并失败,出现多个错误,请参阅日志

在检查清单合并时显示

合并错误:错误:在属性:android:appComponentFactory的行:31处指定的tools:replace,但未指定新值app主清单(此文件),第30行错误:验证失败,退出了app主清单(此文件)] >

我不知道错误。这是build.gradle(app)

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 "com.packagename"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode 54
    versionName "5.4"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
    multiDexEnabled true
    ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'

}
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
lintOptions {
    checkReleaseBuilds false
    abortOnError false
}
packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE-FIREBASE.txt'
    exclude 'META-INF/NOTICE'
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
}
 repositories {
google()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
maven {
    url "https://oss.sonatype.org/content/repositories/snapshots"
  }
 }

 dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-database:19.1.0'
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'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.volley:volley:1.1.1'

implementation 'com.google.android.gms:play-services-identity:17.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.google.firebase:firebase-perf:19.0.0'
implementation 'com.google.android.gms:play-services-analytics:17.0.0'

implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
    transitive = true;
}
implementation 'com.google.code.gson:gson:2.8.2'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'com.github.bumptech.glide:glide:4.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'
implementation 'com.facebook.android:facebook-android-sdk:4.22.0'
implementation 'com.wefika:flowlayout:0.4.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation project(':sdkui')
implementation 'com.android.support:design:28.0.0'
implementation 'com.zopim.android:sdk:1.4.2'

/* Snappydb (cache/db) */

/*For shimmer effect*/
implementation 'com.facebook.shimmer:shimmer:0.4.0'
implementation 'com.snappydb:snappydb-lib:0.5.2'

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

请帮助我解决此问题

我也知道这类问题,但我的问题并未通过这些答案解决。今天,我在我的应用程序中添加了新版本的PayU Money,突然显示错误。我已经转换了整个...

android android-manifest androidx
2个回答
0
投票

相同的活动名称在mainfest文件中多次出现。。


0
投票

在清单的<application />标记内添加这2行

© www.soinside.com 2019 - 2024. All rights reserved.