0

I use this library https://github.com/evernote/android-state

My dependency as below

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.github.livefront:bridge:v1.1.2'
    implementation 'com.evernote:android-state:1.4.0' 
    kapt 'com.evernote:android-state-processor:1.4.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'
}

I got the below 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-21:19 to override.

If I remove implementation 'com.evernote:android-state:1.4.0' then all works well. How could I resolve this?

I tried

implementation ('com.evernote:android-state:1.4.0')  {
    exclude group: 'com.android.support'
}

but same problem persist.

Elye
  • 53,639
  • 54
  • 212
  • 474

1 Answers1

0

I found out that I need to exclude 'androidx.core' instead

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.github.livefront:bridge:v1.1.2'
    implementation ('com.evernote:android-state:1.4.0')  {
        exclude group: 'androidx.core'
    }
    kapt 'com.evernote:android-state-processor:1.4.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'
}
Elye
  • 53,639
  • 54
  • 212
  • 474