martmists
11/15/2024, 3:06 PMlazy
in common code between JS and JVM? It seems to have a different definition (though for JS the type reads as <ERROR CLASS>
on the docs)Oleg Yukhnevich
11/15/2024, 3:24 PMmartmists
11/15/2024, 4:09 PMlazy
I just get an unresolved reference unfortunately. The only defined sourcesets are JVM, Android and JS (IR)martmists
11/15/2024, 4:10 PMfun test() {
val x by lazy { // Unresolved reference 'lazy'
1
}
}
martmists
11/15/2024, 4:12 PMplugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
id("com.android.library")
}
repositories { ... }
kotlin {
jvm("desktop")
js(IR) {
browser()
binaries.library()
}
androidTarget()
sourceSets {
val commonMain by getting {
// ...
}
val jvmMain by creating {
dependsOn(commonMain)
}
val desktopMain by getting {
dependsOn(jvmMain)
}
val androidMain by getting {
dependsOn(jvmMain)
}
}
}
android {
// ...
}
martmists
11/15/2024, 4:28 PMOleg Yukhnevich
11/15/2024, 5:53 PMmartmists
11/15/2024, 8:14 PMval jsMain by getting {
dependsOn(commonMain)
dependencies {
api(kotlin("stdlib-js", Versions.kotlin))
}
}
Strange that stdlib-js isn't automatically appliedmartmists
11/16/2024, 8:47 PMmartmists
11/16/2024, 9:00 PMmartmists
11/16/2024, 9:15 PMmavenLocal