https://kotlinlang.org logo
a

Amritansh

12/11/2020, 8:35 PM
Hi, I am trying to integrate a KMM library into my existing android project but I am getting this error when I try to run the app
Copy code
Duplicate class kotlinx.coroutines.AbstractCoroutine found in modules jetified-kotlinx-coroutines-core-1.3.5.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5) and jetified-kotlinx-coroutines-core-jvm-1.3.9-native-mt-2.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.3.9-native-mt-2
My android app uses following versions
Copy code
const val coroutines_core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5"
    const val coroutines_android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5"
    const val coroutines_test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.5"
But my KMM library uses
1.3.9-native-mt-2
Any idea how can I resolve this?
This is what I ended up doing
Copy code
implementation('<My multiplatform library>') {
        exclude group: 'org.jetbrains.kotlinx', module:'kotlinx-coroutines-core-jvm'
    }
6 Views