question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module with the Main dispatcher had failed to initialize

See original GitHub issue

Getting this error on android. coroutiens version 1.0.0 java.lang.IllegalStateException: Module with the Main dispatcher had failed to initialize at kotlinx.coroutines.internal.MissingMainCoroutineDispatcher.missing(MainDispatchers.kt:79) at kotlinx.coroutines.internal.MissingMainCoroutineDispatcher.isDispatchNeeded(MainDispatchers.kt:54) at kotlinx.coroutines.DispatchedKt.resumeCancellable(Dispatched.kt:373) at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:25) at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:109) at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:160) at kotlinx.coroutines.channels.ActorKt.actor(Actor.kt:121) at kotlinx.coroutines.channels.ActorKt.actor$default(Actor.kt:112)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:28 (4 by maintainers)

github_iconTop GitHub Comments

26reactions
firelonelycommented, Jul 5, 2019

Please add implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:version" the version as same as implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:version" I do this, solved it. it maybe help you.

13reactions
JabezNzomo99commented, Jan 28, 2019

Upgrading to 1.1.0 solved it for me as well. implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin coroutine unit test fails with "Module with the Main ...
Main) it works fine. java.lang.IllegalStateException: Module with the Main dispatcher had failed to initialize. For tests Dispatchers.setMain ...
Read more >
Module with the Main dispatcher had failed to initialize.
Module with the Main dispatcher had failed to initialize. For tests Dispatchers.setMain from kotlinx-coroutines-test module can be used.
Read more >
Test Coroutine Scheduler - Mobile Dev Notes
IllegalStateException : Module with the Main dispatcher had failed to initialize. For tests Dispatchers.setMain from kotlinx-coroutines-test ...
Read more >
Say goodbye to Flakiness: Testing Coroutines and Kotlin ...
... message saying Module with the Main dispatcher had failed to initialize. For tests Dispatchers.setMain from kotlinx-coroutines-test module can be used.
Read more >
Hey I am getting error on my unit test | Android - Kotlinlang
... Module with the Main dispatcher had failed to initialize. For tests Dispatchers.setMain from kotlinx-coroutines-test module can be used at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found