Skip to content

CoroutineExecutor exception when using scope.launch #71

Answered by arkivanov
malliaridis asked this question in Q&A
Discussion options

You must be logged in to vote

It seems that the issue you are having is actually not related to MVIKotlin, but rather a general coroutines question. You should definitely use Dispatchers.Main, but as you noticed JVM doesn't have a main dispatcher by default. You are correct, for Compose for Desktop you should add kotlinx-coroutines-swing as a dependency. It will add the main dispatcher for Swing.

The error Module with the Main dispatcher had failed to initialize. suggests that the main dispatcher is not missing, but failed to initialise. It's hard to say why without the full stack trace, but most likely some dependency (maybe transitive) brought the Main dispatcher for Android.

First of all, please double check that y…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@malliaridis
Comment options

Answer selected by malliaridis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants