Closed Mikkareem closed 1 week ago
i think you need -> implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.8.1") (check if this version is the latest)
You can find documentation here: https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-viewmodel.html
When running coroutines in a
ViewModel
, remember that theViewModel.viewModelScope
value is tied to theDispatchers.Main.immediate
value, which might be unavailable on desktop by default. To make ViewModel coroutines work correctly with Compose Multiplatform, add thekotlinx-coroutines-swing
dependency to your project. See theDispatchers.Main
documentation for details.
The dependencies I include,
The Runtime Exception which I get is,