Kotlin/kmp-production-sample

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

SeanBlahovici opened this issue · 2 comments

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)

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

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.