Skip to content

NoClassDefFoundError on Android 5 and 6 after upgrading to v2 #31

@guillaume-tgl

Description

@guillaume-tgl

After upgrading TelemetryDeck to v2.x, I started getting crashes on Android 5 and 6 devices with the following stacktrace:

java.lang.NoClassDefFoundError: io.ktor.util.collections.ConcurrentMap$$ExternalSyntheticLambda0
         at io.ktor.util.collections.ConcurrentMap.computeIfAbsent(ConcurrentMapJvm.kt:19)
         at io.ktor.client.engine.cio.CIOEngine.selectEndpoint(CIOEngine.kt:118)
         at io.ktor.client.engine.cio.CIOEngine.execute(CIOEngine.kt:76)
         at io.ktor.client.engine.HttpClientEngine$executeWithinCallContext$2.invokeSuspend(HttpClientEngine.kt:99)
         at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)

It looks like this is due to the upgrade to Ktor CIO v2, which requires Java desugaring for Android 6 and before: https://ktor.io/docs/client-engines.html#minimal-version

An explanation on how to configure desugaring should be added to the README.
One solution to avoid using desugaring would be to use OkHttp instead of CIO, as it's compatible with Android 5+.

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