Mihai Voicescu
11/19/2021, 5:41 PMpluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.namespace == "com.android") {
useModule("com.android.tools.build:gradle:4.1.2")
}
}
}
plugins {
id("com.android.library") apply false
kotlin("multiplatform") version kotlin_version apply false
kotlin("plugin.serialization") version kotlin_version apply false
subproject `build.gradle.kts`:
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
id("com.android.library")
}
kotlin {
js {browser {
}}}
Short trace:
org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/mihaivo/IdeaProjects/gaia/gaia-phone-client/build.gradle.kts' line: 26
Caused by: org.gradle.api.reflect.ObjectInstantiationException: Could not create an instance of type org.jetbrains.kotlin.gradle.targets.js.subtargets.KotlinBrowserJs.
at org.gradle.internal.instantiation.generator.DependencyInjectingInstantiator.doCreate(DependencyInjectingInstantiator.java:69)
at org.gradle.internal.instantiation.generator.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:55)
at org.gradle.api.internal.model.DefaultObjectFactory.newInstance(DefaultObjectFactory.java:85)
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 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.
See: <https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl>
at org.jetbrains.kotlin.gradle.targets.js.MultiplePluginDeclarationDetector.detect(MultiplePluginDeclarationDetector.kt:26)
at org.jetbrains.kotlin.gradle.targets.js.MultiplePluginDeclarationDetector$Companion.detect(MultiplePluginDeclarationDetector.kt:52)
at org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin.apply(NodeJsRootPlugin.kt:23)
hfhbd
11/19/2021, 6:42 PMMihai Voicescu
11/19/2021, 6:52 PMid("com.android.library") version "7.0.3" apply false
hfhbd
11/20/2021, 12:25 AMMihai Voicescu
11/22/2021, 9:21 AM