Remy Benza
04/23/2025, 9:30 AMRemy Benza
04/23/2025, 9:31 AMbroadway_lamb
04/23/2025, 9:31 AMbuild.gradle.kts
by any chance?Remy Benza
04/23/2025, 9:32 AMRemy Benza
04/23/2025, 9:32 AMRemy Benza
04/23/2025, 9:35 AMArtem Kobzar
04/23/2025, 9:41 AMbuilld.gradle
of the web application. You use outdated (and deprecated) kotlin("js")
plugin, however to use all the features of the multiplatform code you need to use kotlin("multiplatform")
instead. It should give you access to the commonMain
of other modules.
So, your web application build.gradle.kts
:
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalDistributionDsl
// WebApp
plugins {
kotlin("multiplatform")
}
group = "com.example"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
google()
}
kotlin {
js(IR) {
browser {
// Enables webpack dev server, source maps, etc.
commonWebpackConfig {
cssSupport {
enabled = true
}
}
webpackTask {
mainOutputFileName = "main.js"
}
@OptIn(ExperimentalDistributionDsl::class)
distribution {
// Copy font files to output directory
copy {
from("$projectDir/src/jsMain/resources/fonts")
into("${layout.buildDirectory}/distributions/fonts")
}
}
}
binaries.executable()
}
sourceSets {
val jsMain by getting {
dependencies {
implementation(project(":shared"))
implementation("org.jetbrains.kotlin:kotlinx-atomicfu-runtime:2.1.20")
implementation("com.juul.indexeddb:core:0.7.1")
val version = "2025.3.11"
val prefix = "org.jetbrains.kotlin-wrappers:kotlin-"
implementation("${prefix}react:$version-19.0.0")
implementation("${prefix}react-dom:$version-19.0.0")
implementation("${prefix}react-router:$version-6.28.2")
implementation(libs.kotlinx.serialization.json)
implementation("${prefix}css:$version")
implementation("${prefix}browser:$version")
implementation("${prefix}js:$version")
implementation("${prefix}styled-next:$version")
implementation("${prefix}js-core:$version")
implementation("${prefix}emotion:$version")
implementation("${prefix}mui-material:$version-5.16.14")
}
}
}
}
tasks.withType<Copy> {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
NB: the source set (with its directory) you named main
should be renamed to jsMain
Remy Benza
04/23/2025, 9:42 AMRemy Benza
04/23/2025, 9:43 AMRemy Benza
04/23/2025, 9:44 AMRemy Benza
04/23/2025, 9:44 AMRecordingManager
is code from the web module itself, when i switch back to the 'old' js plugin it works normally againArtem Kobzar
04/23/2025, 9:45 AMRemy Benza
04/23/2025, 9:45 AMArtem Kobzar
04/23/2025, 9:46 AMRemy Benza
04/23/2025, 9:48 AMRemy Benza
04/23/2025, 9:48 AM// Project global build.gradle
plugins {
val kotlinVersion = "2.1.20"
// KSP plugin
id("com.google.devtools.ksp") version "$kotlinVersion-2.0.0" apply false
// Android plugins
id("com.android.application") version "8.8.2" apply false
id("org.jetbrains.kotlin.android") version kotlinVersion apply false
// Kotlin Multiplatform libs
kotlin("multiplatform") version kotlinVersion apply false
kotlin("plugin.serialization") version kotlinVersion apply false
}
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url = uri("<https://jitpack.io>") }
}
dependencies {
val kotlinVersion = libs.versions.kotlin
classpath("com.android.tools.build:gradle:8.8.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.56.1")
classpath("com.google.gms:google-services:4.4.2")
classpath("com.google.firebase:firebase-crashlytics-gradle:3.0.3")
}
}
Remy Benza
04/23/2025, 9:49 AMlibs.versions.kotlin
is also 2.1.20, for some reason i could not reference this toml file version inside plugins {} blockRemy Benza
04/23/2025, 9:52 AMRegistered task dependencies: androidApp:releaseCompileClasspath
Skipping misunderstood TO dep string: project :shared
Skipping misunderstood TO dep string: com.google.firebase:firebase-analytics
Skipping misunderstood TO dep string: com.google.firebase:firebase-crashlytics
Skipping misunderstood TO dep string: com.google.firebase:firebase-appcheck-debug
Skipping misunderstood TO dep string: com.google.firebase:firebase-appcheck-playintegrity
Skipping misunderstood TO dep string: com.google.firebase:firebase-perf
Skipping misunderstood TO dep string: com.google.firebase:firebase-messaging
Skipping misunderstood TO dep string: com.squareup.okhttp3:okhttp
Skipping misunderstood TO dep string: com.squareup.okhttp3:logging-interceptor
Skipping misunderstood TO dep string: org.jetbrains.kotlin:kotlin-reflect
Starting dependency analysis
Registered task dependencies: androidApp:kotlinCompilerPluginClasspathRelease
Starting dependency analysis
Registered task dependencies: androidApp:kotlinCompilerPluginClasspathReleaseUnitTest
Starting dependency analysis
Variant Selection Exception: org.gradle.internal.component.resolution.failure.exception.VariantSelectionByAttributesException caused by Resolution Failure: org.gradle.internal.component.resolution.failure.type.NoCompatibleVariantsFailure
Variant Selection Exception: org.gradle.internal.componen
Remy Benza
04/23/2025, 9:52 AMRemy Benza
04/23/2025, 9:56 AMRemy Benza
04/23/2025, 10:19 AMRemy Benza
04/23/2025, 10:19 AMRemy Benza
04/23/2025, 10:24 AM