Hello while working on multiplatform project, I am...
# multiplatform
r
Hello while working on multiplatform project, I am sharing mu compose UI between android and Web I have created a
composable
shared multiplatform module, inside that I have put some compose libraries as
commonMain
Android app runs fine, but when I try to run
./gradlew jsBrowserRun
it fails to resolve all the compose dependencies
Here is the stacktrace
Copy code
* What went wrong:
Could not determine the dependencies of task ':composables:webPackageJson'.
> Could not resolve all dependencies for configuration ':composables:webNpm'.
   > Could not resolve org.jetbrains.compose.foundation:foundation:1.0.1.
     Required by:
         project :composables
      > No matching variant of org.jetbrains.compose.foundation:foundation:1.0.1 was found. The consumer was configured to find a usage of 'kotlin-runtime' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js', attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir' but:
          - Variant 'debugApiElements-published' capability org.jetbrains.compose.foundation:foundation:1.0.1 declares a library:
              - Incompatible because this component declares an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'ir')
          - Variant 'debugRuntimeElements-published' capability org.jetbrains.compose.foundation:foundation:1.0.1 declares a runtime of a library:
              - 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 'js'
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'ir')
          - Variant 'desktopApiElements-published' capability org.jetbrains.compose.foundation:foundation:1.0.1 declares a library:
              - Incompatible because this component declares an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                  - Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'ir')
c
Might be a better question for #compose-web specifically? Also, maybe I'm out of the loop, but I thought you couldn't share UI between android and web. Did that change recently?
r
Oh I was not ware of that, I thought compose web is a part of compose multiplatform so web and android could be supported or atleast some UI components
let me ask there
d
Not currently, though give it another few months and the answer may change.