Kotlin / kmp-production-sample

This is an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile. It's a simple RSS reader, and you can download it from the App Store and Google Play. It's been designed to demonstrate how KMM can be used in real production projects.
https://kotlinlang.org/lp/mobile/
MIT License
2.01k stars 224 forks source link

Compose desktop app: Module with the Main dispatcher had failed to initialize #53

Closed SeanBlahovici closed 2 years ago

SeanBlahovici commented 2 years ago

App crashes on launch when trying to launch the app from the desktopApp/App.kt main function. This is after checking out the desktop_web tag.

Stack trace:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Module with the Main dispatcher had failed to initialize. For tests Dispatchers.setMain from kotlinx-coroutines-test module can be used at kotlinx.coroutines.internal.MissingMainCoroutineDispatcher.missing(MainDispatchers.kt:118) at kotlinx.coroutines.internal.MissingMainCoroutineDispatcher.isDispatchNeeded(MainDispatchers.kt:96) at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:319) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30) at kotlinx.coroutines.BuildersKt__Builders_commonKt.startCoroutineImpl(Builders.common.kt:192) at kotlinx.coroutines.BuildersKt.startCoroutineImpl(Unknown Source) at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:134) at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56) at kotlinx.coroutines.BuildersKt.launch(Unknown Source) at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47) at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source) at com.github.jetbrains.rssreader.app.FeedStore.dispatch(FeedStore.kt:57)

terrakok commented 2 years ago

Are you sure you have selected right git commit? Try to:

git reset --hard HEAD
git fetch --tags --force
git checkout tags/desktop_web
./gradlew run
SeanBlahovici commented 2 years ago

Are you sure you have selected right git commit? Try to:

git reset --hard HEAD
git fetch --tags --force
git checkout tags/desktop_web
./gradlew run

Worked, thanks.