Duplicate Kotlin class: how to fix "Duplicate class" error in Android
Hi everyone! I'm a beginner in Kotlin and Android development, and I've encountered an error that I can't seem to fix. When building the project, I get:
Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk8-1.7.0 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.0)
I'm using Android Studio, project in Kotlin. In build.gradle (app) I have the following dependencies:
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.google.code.gson:gson:2.10.1'
}
I read that this is because
No answers yet.
Log in to leave an answer
Blogs