:mega: `kotlinx.coroutines` `1.11.0-rc01` is here!...
# coroutines
d
📣
kotlinx.coroutines
1.11.0-rc01
is here! Highlights: • Improved handling of exceptions without propagation paths on JS and Wasm/JS. •
Promise
-related functions are moved to the
web
target. • Structured concurrency-related KDocs rewritten from the ground up. • Major bugfixes. Details: https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.11.0-rc01 This is a release candidate, so please try it out and let us know what you think.
K 23
👀 1
📣
kotlinx.coroutines
1.11.0
is here! Details: https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.11.0
🎉 17
👍 1
r
Releases note have a little mistake
thank you color 1
o
After bumping I get this;
Copy code
│  Error: java.lang.NoSuchMethodError: 'java.lang.Object kotlinx.coroutines.BuildersKt.runBlockingK$default(kotlin.coroutines.CoroutineContext, kotlin.jvm.functions.Function2, int, java.lang.Object)'
      │    java.lang.NoSuchMethodError: 'java.lang.Object kotlinx.coroutines.BuildersKt.runBlockingK$default(kotlin.coroutines.CoroutineContext, kotlin.jvm.functions.Function2, int, java.lang.Object)'
I’ve checked breaking changes, but it is a bit unclear what needs changing. Any ideas?
d
kotlinx.coroutines
only introduced
runBlockingK
in this exact release. This means that the code where this error is thrown is run using a sub-1.11.0 version of
kotlinx.coroutines
, but was compiled with 1.11.0. My first guess is a problem with how your project is set up. Please make sure: • You are doing a clean build: this may be the result of an incremental compilation bug. • The Kotlin version is at least 2.2.20. • If your project is multi-module, all modules have the updated
kotlinx.coroutines
version. If you could send me a project where the issue reproduces, I'll figure out what caused it and how it can be fixed.
o
Thanks for the answer, in the meantime I am checking the direction you gave. I can say; • Kotlin is latest
kotlin = "2.3.21"
• If your project is multi-module, all modules have the updated
kotlinx.coroutines
version.
◦ Could be transitive indeed, but I generally use one version and one library definition from version catalog. It is an open-source project, here is the renovate PR run for kotlinx.coroutines: https://github.com/Trendyol/stove/actions/runs/25655482410/job/75302855632?pr=1170 can be reproducible locally
👀 1
d
Got it. Is there an easy way to run the failing tests without Docker, or is Docker required?
o
Docker is required yes for that tests
👌 1
I think I have found the problem. It is indeed transitive library problem, not all the libraries have updated the coroutines yet — as expected, my usage fails in runtime, I am now enforcing it with;
Copy code
subprojects {
  configurations.all {
    this.resolutionStrategy {
      eachDependency {
        if (requested.group == libs.kotlinx.core.get().group && requested.name.startsWith("kotlinx-coroutines")) {
          useVersion(libs.versions.kotlinx.asProvider().get())
        }
      }
    }
  }
}
Copy code
./gradlew :examples:quarkus-example:dependencyInsight --configuration testRuntimeClasspath --dependency org.jetbrains.kotlinx:kotlinx-coroutines-core --no-daemon
But I think that’s a workaround that should not be necessary for a minor update
d
After digging in deeper, I found the cause. The problem is that the Quarkus BOM also includes
kotlinx.coroutines
versions: https://repo1.maven.org/maven2/io/quarkus/quarkus-bom/3.35.2/quarkus-bom-3.35.2.pom This means that your library correctly declares its dependency on
kotlinx.coroutines
1.11.0, but the example project where the test fails refuses to use 1.11.0, since the Quarkus BOM demands that the version is exactly 1.10.2. You could wait for Quarkus to upgrade to a newer
kotlinx.coroutines
, but in general, this is a structural issue with your project. Since you're publishing a library, it makes sense to avoid upgrading to newer versions of dependencies for as long as possible. You don't want to force users of your library to use the newest `kotlinx.coroutines`—what if your user has some reasons to stay on an older version (for example, because of the Quarkus BOM)? For example, the RxJava integration in
kotlinx.coroutines
still depends on RxJava 3.0.2 (published in 2020: https://github.com/ReactiveX/RxJava/releases/tag/v3.0.2).
o
Thanks a lot for sparing time for it! I agree, I will pin the kotlinx.coroutines versions to 1.10.2 for now to be safe