Jakub Zalas
06/06/2023, 11:23 AMCaused by: org.jetbrains.kotlin.gradle.utils.IsolatedKotlinClasspathClassCastException: The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
That's after adding a dependency on foo:
kotlin {
jvm {
jvmToolchain(19)
withJava()
}
sourceSets {
@Suppress("UNUSED_VARIABLE")
val jvmMain by getting {
dependencies {
implementation(compose.desktop.currentOs)
implementation(project(":foo"))
}
}
}
}
Only adding dependencies on another multiplatform project is documented: https://kotlinlang.org/docs/multiplatform-add-dependencies.html#dependency-on-another-multiplatform-project
Can I assume my use case is unsupported or is there a simple solution?Jakub Zalas
06/06/2023, 11:39 AMplugins {
kotlin("multiplatform").apply(false)
}
Adam S
06/06/2023, 11:41 AMbuild.gradle.kts
should work.Jakub Zalas
06/06/2023, 11:50 AM