Cleveland Shaw
05/28/2025, 11:08 AMKoin: 4.1.0-RC1
Koin Annotations: 2.0.1-RC1
Kotlin: 2.1.21
Compose Multiplatform: 1.8.1
KSP: 2.1.21-2.0.1
Here are the dependencies involved:
[libraries]
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-annotations = { module = "io.insert-koin:koin-annotations", version.ref = "koinAnnotations" }
koin-ksp-compiler = { module = "io.insert-koin:koin-ksp-compiler", version.ref = "koinAnnotations" }
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin" }
koin-compose-viewmodel = { module = "io.insert-koin:koin-compose-viewmodel", version.ref = "koin" }
This is my Gradle setup:
implementation(libs.koin.core)
implementation(libs.koin.compose)
implementation(libs.koin.compose.viewmodel)
api(libs.koin.annotations)
I’m encountering an issue during build related to duplicate classes, and I believe it’s a conflict between koin-annotations and koin-core-annotations. Here’s the actual error message:
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class org.koin.core.annotation.InjectedParam found in modules koin-annotations-jvm-2.0.1-RC1.jar -> koin-annotations-jvm-2.0.1-RC1 (io.insert-koin:koin-annotations-jvm:2.0.1-RC1) and koin-core-annotations-jvm-4.1.0-RC1.jar -> koin-core-annotations-jvm-4.1.0-RC1 (io.insert-koin:koin-core-annotations-jvm:4.1.0-RC1)
Duplicate class org.koin.core.annotation.Provided found in modules koin-annotations-jvm-2.0.1-RC1.jar -> koin-annotations-jvm-2.0.1-RC1 (io.insert-koin:koin-annotations-jvm:2.0.1-RC1) and koin-core-annotations-jvm-4.1.0-RC1.jar -> koin-core-annotations-jvm-4.1.0-RC1 (io.insert-koin:koin-core-annotations-jvm:4.1.0-RC1)
It seems like there’s a conflict between koin-annotations and koin-core-annotations jars. Is there a recommended way to avoid this duplication? Should I be aligning versions differently or excluding one of the modules manually?
Any guidance on how to cleanly resolve this in a KMP setup would be greatly appreciated 🙏
Thanks again for all your great work on Koin!arnaud.giuliani
05/28/2025, 4:53 PMCleveland Shaw
05/28/2025, 4:58 PMGuyaume Tremblay
05/29/2025, 12:42 PMCleveland Shaw
05/29/2025, 1:59 PMGuyaume Tremblay
06/04/2025, 6:55 PMarnaud.giuliani
06/05/2025, 7:21 AM