0

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'
Zoe
  • 27,060
  • 21
  • 118
  • 148
Aovin Mahmud
  • 204
  • 3
  • 18

3 Answers3

1

-Try adding this lines to application tag in manifest.

    tools:replace="android:appComponentFactory"
    android:appComponentFactory="androidx"
  • Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details. – Aovin Mahmud Mar 08 '19 at 08:56
0

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

enter image description here

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

  • Merging Errors: Error: tools:replace specified at line:10 for attribute android:appComponentFactory, but no new value specified app main manifest (this file), line 9 Error: Validation failed, exiting app main manifest (this file) – Aovin Mahmud Mar 08 '19 at 07:47
  • If possible post the whole manifest, so we can take a look at this lines. – Alexander Cavalheiro Becker Mar 08 '19 at 10:44
0

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.

Aovin Mahmud
  • 204
  • 3
  • 18