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

christophsturm

11/03/2023, 11:11 AM
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)
z

zsmb

11/03/2023, 12:34 PM
Which source set's dependencies are you adding that wasm coroutine library to?
p

Pablichjenkov

11/03/2023, 12:36 PM
You can ask in #compose-web and #webassembly
c

christophsturm

11/03/2023, 4:49 PM
adding it to the common source set. but will ask in webassembly, did not know that there is a channel for that, thanks!
z

zsmb

11/03/2023, 4:51 PM
I believe you can only add the wasm artifact to the wasm source set specifically
But you'll get a proper answer over there for sure 😃
9 Views