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.

Main dispatcher missing on version 1.2.1 (android gradle plugin 3.5.0-beta02)

See original GitHub issue

When upgrading our project to coroutines version 1.2.1 (from 1.2.0), we get a

    java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android'

Here are the relevant parts of our build.gradle:


root:

    ext.coroutines_version = '1.2.1'

one of many library modules in our project module: (all looking basically the same, there is no import of another version somewhere)


dependencies {
    /* Test */
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    /* Kotlin */
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

    /* Coroutines */
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"


Gradle version: 5.4.1 Android gradle plugin: 3.5.0-beta02


The same configuration works using the older agp version 3.4.0 or the older coroutines version 1.2.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
LouisCADcommented, May 25, 2019

I just reported it myself to bring awareness early to the Android Gradle plugin team: https://issuetracker.google.com/issues/133495912 @sellmair if you have additional details that could help them, please, share them into that linked issue.

1reaction
elizarovcommented, May 23, 2019

May I ask to report the bug to AGP then?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module with Main dispatcher is missing - Stack Overflow
Using just the kotlinx-coroutines-android version solves the problem.
Read more >
runtime NPE in Kotlin Coroutine Dispatcher - Issue Tracker
... Plugin for Android. classpath 'com.android.tools.build:gradle:3.5.0-alpha03' ... 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 >
Diff - jdk8-b08^1..jdk8-b08 - toolchain/jdk/jdk9_jdk
debuginfo support by setting ALT_OBJCOPY to a non-existent path + OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) + endif +endif + +ifdef ...
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