Skip to content

Tangem SDK Crashes with kotlinx-coroutines 1.8.x/1.9.x Due to Missing asFlow Method #9

@silent-grass

Description

@silent-grass

Environment

  • Tangem SDK version: releases-5.34-579 (and all previous versions)
  • Dependencies:
    implementation("com.tangem.tangem-sdk-kotlin:core:releases-5.34-579")
    implementation("com.tangem.tangem-sdk-kotlin:android:releases-5.34-579")
  • Kotlin version: [Your Kotlin version, e.g., 1.9.x]
  • kotlinx-coroutines version: 1.8.x or 1.9.x

Steps to Reproduce

  1. Add the Tangem SDK dependencies above.
  2. Initialize Tangem SDK (with custom SessionViewDelegate if used).
  3. Start a card session (e.g., scan a card).

Expected Behavior

Card session starts without errors.

Actual Behavior

Runtime crash:

java.lang.NoSuchMethodError: No static method asFlow(Lkotlinx/coroutines/channels/BroadcastChannel;)Lkotlinx/coroutines/flow/Flow; in class Lkotlinx/coroutines/flow/FlowKt; or its super classes (declaration of 'kotlinx.coroutines.flow.FlowKt' appears in /data/app/.../base.apk!classes33.dex)
    at com.tangem.common.core.CardSession$start$4.invokeSuspend(CardSession.kt:188)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
    ...

Additional Context

Likely due to incompatibility with newer coroutines where BroadcastChannel.asFlow() was removed. Affects apps using modern coroutines.

Related: tangem/tangem-sdk-android#1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions