简体   繁体   中英

Android Manifest merger failed || Manifest merger failed with multiple errors, see logs

I am working on a App using Firebase. I got a issue which needs to get solved. When i go to run the app it shows in build .

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:10:5-31:19 to override.

I searched the whole internet to solve the issue failed. I also added

tools:replace="android:appComponentFactory"

in the AndroidManifest.xml file. I also followed the answer of This Question. but it didn't work for me saying

Manifest merger failed with multiple errors, see logs

How can i solve this problem. What should i do now.

build.grable

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.offtechitbd.e_orderapp"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

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

    implementation 'com.android.support:appcompat-v7:28.0.0'

    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.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.google.firebase:firebase-core:11.8.0'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.firebaseui:firebase-ui-database:3.2.2'

    implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'io.paperdb:paperdb:2.6'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'

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

Just a tip, in the bottom of the manifest you can access the "Merged Manifest" to check the errors.

在此处输入图片说明

If you can't figure out the erros, post your manifest so we can help.

-Try adding this lines to application tag in manifest.

    tools:replace="android:appComponentFactory"
    android:appComponentFactory="androidx"

Actually i was using implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+' and the android-image-cropper:2.8.+' is Update to support library to AndroidX . So i just changed the version to this

implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'

Now the app is working fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM