Module with the Main dispatcher is missing with version 1.3.1
See original GitHub issueAfter update coroutines from version 1.3.0 to 1.3.1 got this error: If it matter - Android 9.0, without ProGuard
java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android'
at kotlinx.coroutines.internal.MissingMainCoroutineDispatcher.missing(MainDispatchers.kt:90)
at kotlinx.coroutines.internal.MissingMainCoroutineDispatcher.isDispatchNeeded(MainDispatchers.kt:71)
at kotlinx.coroutines.DispatchedKt.resumeCancellable(Dispatched.kt:420)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26)
at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:109)
at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:154)
at kotlinx.coroutines.BuildersKtBuilders_commonKt.launch(Builders.common.kt:54)
at kotlinx.coroutines.BuildersKt.launch(Unknown Source:1)
at kotlinx.coroutines.BuildersKtBuilders_commonKt.launch$default(Builders.common.kt:47)
at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source:1)
at ru.omnidesk.android.app.ui.launcher.LauncherViewModel.prepareEnvironment(LauncherViewModel.kt:82)
at ru.omnidesk.android.app.ui.launcher.LauncherViewModel.defineLaunchDestination(LauncherViewModel.kt:64)
at ru.omnidesk.android.app.ui.launcher.LauncherActivity.handleIntentExtras(LauncherActivity.kt:108)
at ru.omnidesk.android.app.ui.launcher.LauncherActivity.onCreate(LauncherActivity.kt:63)
at android.app.Activity.performCreate(Activity.java:7224)
at android.app.Activity.performCreate(Activity.java:7213)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6806)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Module with Main dispatcher is missing - Stack Overflow
I have fixed by doing both version same 'kotlinx-coroutines-android' and ensure it has the same version ...
Read more >Module with the Main dispatcher is missing with version 1.3.0 ...
This is the latest crash with coroutines version kotlinx-coroutines-android:1.3.0-RC2, AS 3.5, Gradle 5.1.1, AGP 3.4.2, R8 enabled, version 1.4.
Read more >runtime NPE in Kotlin Coroutine Dispatcher - Issue Tracker
Kotlin Coroutines Version : 1.1.1. It throw this exception : Fatal Exception: java.lang.IllegalStateException: Module with the Main dispatcher is missing.
Read more >Dispatchers.Main - Kotlin
A coroutine dispatcher that is confined to the Main thread operating with UI objects. Usually such dispatchers are single-threaded.
Read more >Change log for kotlinx.coroutines
Change log for kotlinx.coroutines. Version 1.3.1. This is a minor update with various fixes: Flow: Fix recursion in combineTransform<T1, T2, R> (#1466).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@elizarov This is very strange, but really cleaning up the project and the build cache, invalidating in Android Studio, the removal of the application from the device helped solve the problem
Same for me. Is anyone is able to understand why it is happening and how to solve it ?