davideas / FlexibleAdapter

Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
Apache License 2.0
3.55k stars 553 forks source link

Manifest Merger failed at build clean proyect #689

Closed arospatricio closed 5 years ago

arospatricio commented 5 years ago

Hello, im trying to implement this in a project and get the 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 <application> element at AndroidManifest.xml:5:5-22:19 to override.

i've tried in a new project with a 4.4 kitkat api and 5, the same error appears. My project uses a 4.4 kitkat api and this is the build.gradlle.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.soporteexterno2.sgto"
        minSdkVersion 19
        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')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.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'
    implementation files('libs/AndroidSwipeLayout-v1.1.8.jar')
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation files('libs/org.json.jar')
    implementation 'com.android.support:recyclerview-v7:28.0.0'

   // Using JCenter
    implementation 'eu.davidea:flexible-adapter:5.1.0'
    implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
    implementation 'eu.davidea:flexible-adapter-livedata:1.0.0-b3'
    // From 1.0.0-b3, library is compiled with data binding v2
    implementation 'eu.davidea:flexible-adapter-databinding:1.0.0'

}

Hope you can help me, i'm exhausted trying to create a selectableadapter for a recyclerview.

arospatricio commented 5 years ago

i found the issue, its because the 5.1.x version uses androidx. tried the 5.0.x and the problem was solved. Thanks anyways :) . The merger conflict its because androidx tried to implement the same libraries/packages (Sorry i'm new at android development and dont know the proper definition) and the program fails, ill stay with the 5.0.x because i think that the android studio refactor will ruin my project.