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.

Caused by: java.lang.NoSuchMethodError kotlinx.coroutines.reactive.FlowSubscription when updating kotlinx-coroutines from 1.3.7 to 1.3.9

See original GitHub issue

Dear Kotlin-team,

I m having a rective spring-boot project (spring-boot version 2.3.3.). I updated Kotlin to version 1.4 and kotlinx-coroutines-core and kotlinx-coroutines-reactor to 1.3.9.

I am using spring-boot webclient to retrieve data.

return WebClient.create(url) .get() .retrieve() .bodyToFlow()

after I updated I am getting this exception:

Caused by: java.lang.NoSuchMethodError: kotlinx.coroutines.reactive.FlowSubscription.<init>(Lkotlinx/coroutines/flow/Flow;Lorg/reactivestreams/Subscriber;Lkotlin/coroutines/CoroutineContext;)V at kotlinx.coroutines.reactor.FlowAsFlux.subscribe(ReactorFlow.kt:39) at org.springframework.http.server.reactive.ChannelSendOperator.subscribe(ChannelSendOperator.java:77) at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150) at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:73) at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:156) at kotlinx.coroutines.reactor.MonoCoroutine.onCompleted(Mono.kt:66) at kotlinx.coroutines.AbstractCoroutine.onCompletionInternal(AbstractCoroutine.kt:104) at kotlinx.coroutines.JobSupport.tryFinalizeSimpleState(JobSupport.kt:294) at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:853) at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:825) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:111) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:333)

In kotlinx-coroutines-core and kotlinx-coroutines-reactor to 1.3.7. it is working as expected.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
elizarovcommented, Sep 22, 2020

The picture clearly shows that you have kotlinx-coroutines-core:1.3.9 and kotlinx.coroutines-reactive:1.3.8. It is not designed to work this way. Versions of different modules must match.

2reactions
MrBuddyCasinocommented, Oct 5, 2020

I have just hit the same error on upgrading to 1.3.9, and the problems was that kotlinx-coroutines-reactive:1.3.3 was somehow ending up in my classpath. The only way to fix it was to explicitly pull in the 1.3.9 version as well:

    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${property("coroutinesVersion")}")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:${property("coroutinesVersion")}")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactive:${property("coroutinesVersion")}")
Read more comments on GitHub >

github_iconTop Results From Across the Web

Coroutines: binary incompatibility between 1.3.9 and 1.4.2 on ...
asFlow() using dependency org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9 and compiling against kotlin 1.3.9; use the library from an app compiled ...
Read more >
kotlin, coroutines, NoSuchMethodError when calling overriden ...
It fails with exception: java.lang.NoSuchMethodError: com.example.lib.OtherModuleInterface.test(Lkotlin/coroutines/experimental/Continuation;) ...
Read more >
Kotlinx Coroutines Reactor - Maven Repository
Version Vulnerabilities Repository Usages Date 1.6.x 1.6.4 Central 148 Jul 13, 2022 1.6.3 1.6.x Central 130 Jun 20, 2022 1.6.3‑native‑mt 1.6.x Central 0 Jun 23, 2022...
Read more >
kotlinx-coroutines-test
Overview. This package provides utilities for efficiently testing coroutines. Name, Description. runTest, Runs the test code, automatically skipping ...
Read more >
org.jetbrains.kotlinx : kotlinx-coroutines-android : 1.3.9
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-coroutines-android.svg?label=Maven%20Central)](https://search.maven.
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