compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

compile WasmJs FAILED

Open KevinnZou opened this issue 9 months ago • 1 comments

Describe the bug Encountered an compilation error when compiling a WASM/JS target

Affected platforms

  • Web (K/Wasm) - Canvas based API

Versions kotlin.version=1.9.23 agp.version=8.1.1 compose.version=1.6.1 coroutines.version=1.8.0

Stacktrace

Task :sample:shared:compileDevelopmentExecutableKotlinWasmJs FAILED e: Module "org.jetbrains.compose.foundation:foundation" has a reference to symbol org.jetbrains.skiko/SkikoKey.platformKeyCode.<get-platformKeyCode>|<get-platformKeyCode>(){}[0]. Neither the module itself nor its dependencies contain such declaration.

This could happen if the required dependency is missing in the project. Or if there is a dependency of "org.jetbrains.compose.foundation:foundation" that has a different version in the project than the version that "org.jetbrains.compose.foundation:foundation" was initially compiled with. Please check that the project configuration is correct and has consistent versions of all required dependencies.

The list of "org.jetbrains.compose.foundation:foundation" dependencies that may lead to conflicts:

  1. "kotlin" (a library with unknown version)
  2. "co.touchlab:kermit" (a library with unknown version)
  3. "co.touchlab:kermit-core" (a library with unknown version)
  4. "com.benasher44:uuid" (a library with unknown version)
  5. "components.resources:library" (a library with unknown version)
  6. "compose-webview-multiplatform.sample:shared" (a library with unknown version)
  7. "compose-webview-multiplatform:webview" (a library with unknown version)
  8. "org.jetbrains.androidx.core:core-bundle" (a library with unknown version)
  9. "org.jetbrains.androidx.lifecycle:lifecycle-common" (a library with unknown version)
  10. "org.jetbrains.androidx.lifecycle:lifecycle-runtime" (a library with unknown version)
  11. "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose" (a library with unknown version)
  12. "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel" (a library with unknown version)
  13. "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose" (a library with unknown version)
  14. "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-savedstate" (a library with unknown version)
  15. "org.jetbrains.androidx.navigation:navigation-common" (a library with unknown version)
  16. "org.jetbrains.androidx.navigation:navigation-compose" (a library with unknown version)
  17. "org.jetbrains.androidx.navigation:navigation-runtime" (a library with unknown version)
  18. "org.jetbrains.androidx.savedstate:savedstate" (a library with unknown version)
  19. "org.jetbrains.compose.animation:animation" (a library with unknown version)
  20. "org.jetbrains.compose.animation:animation-core" (a library with unknown version)
  21. "org.jetbrains.compose.annotation-internal:annotation" (a library with unknown version)
  22. "org.jetbrains.compose.collection-internal:collection" (a library with unknown version)
  23. "org.jetbrains.compose.foundation:foundation" (a dependency of the library with unknown version or versions mismatch: "org.jetbrains.compose.foundation:foundation")
  24. "org.jetbrains.compose.foundation:foundation-layout" (a library with unknown version)
  25. "org.jetbrains.compose.material:material" (a library with unknown version)
  26. "org.jetbrains.compose.material:material-icons-core" (a library with unknown version)
  27. "org.jetbrains.compose.material:material-ripple" (a library with unknown version)
  28. "org.jetbrains.compose.runtime:runtime" (a library with unknown version)
  29. "org.jetbrains.compose.runtime:runtime-saveable" (a library with unknown version)
  30. "org.jetbrains.compose.ui:ui" (a library with unknown version)
  31. "org.jetbrains.compose.ui:ui-geometry" (a library with unknown version)
  32. "org.jetbrains.compose.ui:ui-graphics" (a library with unknown version)
  33. "org.jetbrains.compose.ui:ui-text" (a library with unknown version)
  34. "org.jetbrains.compose.ui:ui-unit" (a library with unknown version)
  35. "org.jetbrains.compose.ui:ui-util" (a library with unknown version)
  36. "org.jetbrains.skiko:skiko" (a library with unknown version)
  37. "voyager:voyager-core" (a library with unknown version)
  38. "voyager:voyager-navigator" (a library with unknown version)
  39. "voyager:voyager-tab-navigator" (a library with unknown version)
  40. "org.jetbrains.kotlinx:atomicfu" (a library with unknown version)
  41. "org.jetbrains.kotlinx:kotlinx-coroutines-core" (a library with unknown version)
  42. "org.jetbrains.kotlinx:kotlinx-serialization-core" (a library with unknown version)
  43. "org.jetbrains.kotlinx:kotlinx-serialization-json" (a library with unknown version)

KevinnZou avatar May 13 '24 01:05 KevinnZou

It seems like your project has a dependency on a library which depends on a newer skiko version, while your project depends on older skiko. Newer skiko doesn't have the missing symbol anymore - it's epxected.

Could you please try a new Compose Multiplatform version [1.6.10-rc01](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.6.10-rc01) ?

eymar avatar May 13 '24 13:05 eymar

Since you mentioned that you managed to make K/Wasm target work (here: https://github.com/JetBrains/compose-multiplatform/issues/4811), I close this issue.

eymar avatar May 16 '24 09:05 eymar

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Jul 14 '24 14:07 okushnikov