Closed headsvk closed 7 months ago
It might be related to https://youtrack.jetbrains.com/issue/KT-58759 but it's highly unlikely since you should be seeing a different error
Without BOM is it working well?
Yes it does
how do you declare your gradle config?
I tried various things but I expect this to work:
sourceSets {
// Common
val commonMain by getting {
dependencies {
api("io.insert-koin:koin-bom:3.5.1")
api("io.insert-koin:koin-core")
}
}
}
for bom you need to use platform
keyword, like: platform api(...)
I was running into this issue as well when adding Koin to a new KMP project that I had just created via the create project wizard.
Following the "version catalogs" setup via https://insert-koin.io/docs/setup/koin, I had:
// shared/build.gradle.kts
sourceSets {
commonMain.dependencies {
implementation(libs.koin.bom)
implementation(libs.koin.core)
}
}
This caused sync errors like the original author reported. The problem went away after using platform
per the suggestion above:
sourceSets {
commonMain.dependencies {
implementation(project.dependencies.platform(libs.koin.bom))
implementation(libs.koin.core)
}
}
It might be worth changing the docs at https://github.com/InsertKoinIO/koin/blob/main/docs/setup/koin.md?plain=1#L54 to implementation(project.dependencies.platform(libs.koin.bom))
to make this explicit? I submitted https://github.com/InsertKoinIO/koin/pull/1822 to make that explicit.
Thank for your feedback. It's pushed online 👍
Describe the bug Hi. I tried to use the new Koin BOM but it doesn't work with Kotlin Multiplatform's iOS targets. Is that a limitation of Gradle/Kotlin Multiplatform?
To Reproduce Steps to reproduce the behavior:
io.insert-koin:koin-bom:3.5.1
andio.insert-koin:koin-core
dependencies tocommonMain
Expected behavior iOS targets can resolve the BOM version
Koin module and version:
koin-bom:3.5.1
kotlin:1.9.20