https://kotlinlang.org logo
#webassembly
Title
# webassembly
c

christophsturm

11/03/2023, 4:51 PM
I’m trying to enable wasm on a multiplatform project that uses coroutines, but i get this error message from gradle:
Copy code
> No matching variant of org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2-wasm3 was found. The consumer was configured to find a library for use during 'kotlin-runtime', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'wasm', attribute 'org.jetbrains.kotlin.wasm.target' with value 'wasi', attribute 'org.jetbrains.kotlin.js.public.package.json' with value 'public-package-json' but:
          - Variant 'androidNativeArm32ApiElements-published' capability org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2-wasm3 declares a library:
              - Incompatible because this component declares a component for use during 'kotlin-api', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a component for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'wasm'
(I got the dependency info from https://kotlinlang.org/docs/wasm-libraries.html) the coroutines lib is added to the common source set:
Copy code
sourceSets {
        val commonMain by getting {
            dependencies {
                api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
            }
        }
b

bashor

11/04/2023, 2:17 AM
Did you add custom maven repository?
Copy code
maven("<https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental>")
c

christophsturm

11/04/2023, 8:57 PM
yes!
6 Views