iOS, Android, desktop targets work, but WASM gives...
# compose-web
s
iOS, Android, desktop targets work, but WASM gives me:
Copy code
> Could not resolve androidx.lifecycle:lifecycle-viewmodel:2.9.0-alpha05.
     Required by:
         project :composeApp
      > No matching variant of androidx.lifecycle:lifecycle-viewmodel:2.9.0-alpha05 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.js.public.package.json' with value 'public-package-json', attribute 'org.jetbrains.kotlin.platform.type' with value 'wasm', attribute 'org.jetbrains.kotlin.wasm.target' with value 'js' but:
          - Variant 'androidxSourcesElements':
Replication: https://github.com/SamuelMarks/bug-repo-kmp
m
I believe you need JetBrains common ViewModel instead of the android one https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-viewmodel.html
s
ahhh I had to comment out
Copy code
runtimeOnly(libs.lifecycle.viewmodel)
Then adding
runtimeOnly("org.jetbrains.kotlin:kotlin-reflect:2.1.0-Beta2")
[
runtimeOnly(libs.kotlin.reflect)
] to
desktopMain
androidMain
, and
iosMain
.