Rohan Maity
01/04/2022, 6:24 AMcomposable
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 dependenciesRohan Maity
01/04/2022, 6:24 AM* 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')
Big Chungus
01/04/2022, 7:41 AMRohan Maity
01/04/2022, 7:42 AMRohan Maity
01/04/2022, 8:09 AMcompose.runtime
from commonMain as wellRohan Maity
01/04/2022, 8:10 AMcompose.web.core
from webMain sourceSet
from the shared composable
moduleRohan Maity
01/04/2022, 8:12 AMcompose.runtime
compose.web.core
in my webApp
dependencies
I am still not able to see/use any composable function classesBig Chungus
01/04/2022, 8:12 AMBig Chungus
01/04/2022, 8:13 AMRohan Maity
01/04/2022, 8:15 AMid("org.jetbrains.compose") version Version.MPP_COMPOSE
`Big Chungus
01/04/2022, 8:15 AMRohan Maity
01/04/2022, 8:16 AMIR
compiler onlyRohan Maity
01/04/2022, 8:17 AMcompose.runtime and compose.web.core
does not work when I put them inside the shared module :\Big Chungus
01/04/2022, 8:17 AMBig Chungus
01/04/2022, 8:19 AMRohan Maity
01/04/2022, 8:21 AMimport org.jetbrains.compose.compose
plugins {
kotlin("multiplatform")
id("com.android.library")
id("org.jetbrains.compose") version Version.MPP_COMPOSE
}
kotlin {
android ()
js("web") {
browser()
binaries.executable()
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(project(":shared"))
api(compose.runtime)
}
}
val androidMain by getting {
dependencies {
implementation(compose.foundation)
implementation(compose.ui)
implementation(compose("org.jetbrains.compose.ui:ui-tooling"))
implementation(compose.material)
implementation(compose.materialIconsExtended)
api("androidx.activity:activity-compose:1.4.0")
}
}
val webMain by getting {
dependencies {
api(compose.web.core)
}
}
}
}
android {
compileSdk = Version.COMPILE_SDK
buildToolsVersion = Version.ANDROID_BUILD_TOOLS
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = Version.MIN_SDK
targetSdk = Version.TARGET_SDK
}
buildTypes {
getByName("release") {
isMinifyEnabled = true
}
}
}
Rohan Maity
01/04/2022, 8:22 AMcompose.runtime and compose.web.core
for JS not availableBig Chungus
01/04/2022, 8:24 AMRohan Maity
01/04/2022, 8:25 AMRohan Maity
01/04/2022, 8:29 AMRohan Maity
01/04/2022, 8:29 AMIR
thing I thought I enabled, but somehow I missed. I think I will remember this for sureBig Chungus
01/04/2022, 8:30 AM