Hi team, in my sample compose multiplatform app for android, ios and desktop, i added web support fo...
s

Sunil Kumar

over 2 years ago
Hi team, in my sample compose multiplatform app for android, ios and desktop, i added web support following the official compose web sample imageviewer , but i am not able to run web app, I am not able to resolve some dependencies, like unresolved reference : CanvasBasedWindow and while i am trying to run the app using ./gradlew webAppwasmRun, Then i am Getting following issues in logs:
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':shared:wasmPackageJson'.
> Could not resolve all dependencies for configuration ':shared:wasmNpm'.
   > Could not resolve org.jetbrains.compose.runtime:runtime:1.4.0.
     Required by:
         project :shared
      > No matching variant of org.jetbrains.compose.runtime:runtime:1.4.0 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' but:
          - Variant 'debugApiElements-published' capability org.jetbrains.compose.runtime:runtime:1.4.0 declares a library:
              - Incompatible because this component declares a component for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'wasm'
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
          - Variant 'debugRuntimeElements-published' capability org.jetbrains.compose.runtime:runtime:1.4.0 declares a library for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'wasm'
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
          - Variant 'desktopApiElements-published' capability org.jetbrains.compose.runtime:runtime:1.4.0 declares a library:
              - Incompatible because this component declares a component for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'wasm'
              - Other compatible attribute:
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
And many more similar logs are there Help me please, I want to build an app for all android , ios, desktop and web in single project by sharing compose ui. Thanks