Skip to content

java.lang.ClassCastException: at kotlinx.coroutines.CoroutineDispatcher.releaseInterceptedContinuation (CoroutineDispatcher.kt:108) #2793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dcampogiani opened this issue Jun 29, 2021 · 3 comments
Labels

Comments

@dcampogiani
Copy link

Hi, after upgrading to Kotlin 1.5 and related dependencies we are getting this error:

kotlinx.coroutines.CoroutinesInternalError: 
  at kotlinx.coroutines.DispatchedTask.handleFatalException (DispatchedTask.kt:144)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:115)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.kt:571)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:750)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:678)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:665)
Caused by: java.lang.ClassCastException: 
  at kotlinx.coroutines.CoroutineDispatcher.releaseInterceptedContinuation (CoroutineDispatcher.kt:108)
  at kotlin.coroutines.jvm.internal.ContinuationImpl.releaseIntercepted (ContinuationImpl.kt:118)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:39)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.kt:571)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:750)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:678)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:665)

From our crash reporting tool I'm also getting additional info, here some examples:

Fatal Exception: x0.a.h0
Fatal exception in coroutines machinery for CancellableContinuation(DispatchedContinuation[Dispatchers.IO, Continuation at kotlinx.coroutines.channels.AbstractChannel.receiveCatching-JP2dKIU(AbstractChannel.kt:632)@f58ec7]){Completed}@ef89cf4. Please read KDoc to 'handleFatalException' method and report this incident to maintainers
Fatal Exception: x0.a.h0
Fatal exception in coroutines machinery for CancellableContinuation(DispatchedContinuation[Dispatchers.Default, Continuation at com.dropbox.flow.multicast.StoreRealActor$1.invokeSuspend(StoreRealActor.kt:42)@bde904b]){Completed}@1f640e6. Please read KDoc to 'handleFatalException' method and report this incident to maintainers

We've updated the following dependencies altogether to be compliant with Kotlin 1.5:

  • org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0
  • org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0
  • org.jetbrains.kotlinx:kotlinx-coroutines-rx2:1.5.0
  • org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0
  • org.jetbrains.kotlin:kotlin-reflect:1.5.10
  • org.jetbrains.kotlin:kotlin-allopen:1.5.10
  • org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10
  • org.jetbrains.kotlin:kotlin-serialization:1.5.10
  • org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.3.0
  • org.jetbrains.kotlinx:kotlinx-serialization-core:1.2.1
  • org.jetbrains.kotlinx:kotlinx-serialization-cbor:1.2.1
  • org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.1
  • com.dropbox.mobile.store:store4:4.0.2-KT15

We are not able to provide a code example because we can't find any reference to our code in the stack trace, I'll update this issue if we will be able to isolate the crash.

How can we fix this issue?
Thanks

@dkhalanskyjb
Copy link
Collaborator

Possibly related to #2736, an issue that is already fixed in the develop branch but not in master.

@qwwdfsad qwwdfsad added the bug label Jul 5, 2021
@yandroidUA
Copy link

yandroidUA commented Jul 14, 2021

Update to Kotlin 1.5.21 fix this issue for me

@qwwdfsad
Copy link
Member

Fixed in coroutines 1.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants