I want to import Coil library in my project. I did it like below:
android{
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
implementation("io.coil-kt:coil:0.8.0")
}
The project will sync successfully, But When I want to run the application I 'll face with this error:
Duplicate class androidx.appcompat.content.res.AppCompatResources found in modules classes.jar (androidx.appcompat:appcompat-resources:1.1.0) and classes.jar (androidx.appcompat:appcompat:1.0.0)
Duplicate class androidx.appcompat.content.res.AppCompatResources$ColorStateListCacheEntry found in modules classes.jar (androidx.appcompat:appcompat-resources:1.1.0) and classes.jar (androidx.appcompat:appcompat:1.0.0)
Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat found in modules classes.jar (androidx.appcompat:appcompat-resources:1.1.0) and classes.jar (androidx.appcompat:appcompat:1.0.0)
Duplicate class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat$1 found in modules classes.jar (androidx.appcompat:appcompat-resources:1.1.0) and classes.jar (androidx.appcompat:appcompat:1.0.0)
My app is converted to the AndroidX before. Also, my targetSdkVersion = 29
and minSdkVersion = 17