I am having Gradle problems. I can not add seriali...
# multiplatform
a
I am having Gradle problems. I can not add serialization in a sub-project, without getting the error:
Caused by: java.lang.IllegalStateException: The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
. This is my `settings.gradle.kts`:
Copy code
pluginManagement {
    plugins {
        kotlin("multiplatform") version "1.6.21" apply false
        kotlin("js") version "1.6.21" apply false
        kotlin("plugin.serialization") version "1.6.21" apply false
    }
}

rootProject.name = "scribbles"
include("dom")
include("vdom")
include("web-workers")

include("examples:dom-demo")
include("examples:vdom-demo")
And this is my
web-workers
gradle:
Copy code
plugins {
    kotlin("multiplatform")
    kotlin("plugin.serialization") // <- when commenting out this line it works again
}

repositories {
    mavenCentral()
}

kotlin {
    /** targets **/
}
Here is the repository: https://github.com/avwie/scribbles/tree/e1629ff6d3e4a322c590d92ba00b740b8f1cf6e6 Am I doing something wrong?
e
try adding
Copy code
plugins {
    kotlin("multiplatform") apply false
}
in the root
build.gradle.kts
so that the plugin is in the root classpath. right now it appears that each sub-project's classloader is getting its own copy of the Kotlin plugin, which means they can't cooperate with each other
a
Thanks! I had it in the settings.gradle.kts. But moving it to the build.gradle.kts in the root made sure it worked.