Facing this Ktor crash, anybody got some idea? I t...
# multiplatform
s
Facing this Ktor crash, anybody got some idea? I tried multiple things, but couldnt find a solution for this
Copy code
Fatal Exception: java.lang.IncompatibleClassChangeError: Found interface io.ktor.client.engine.HttpClientEngine, but class was expected (declaration of 'io.ktor.client.engine.HttpClientEngine' appears in /data/app/~~szaQlarMiLX_uT92lZNgvw==/com.foo.bar-n0F0dFVPuEeBqZslgjyDmQ==/base.apk!classes6.dex)
       at io.ktor.client.engine.HttpClientEngine.access$checkExtensions(HttpClientEngine.kt)
       at io.ktor.client.engine.HttpClientEngine$install$1.invokeSuspend(HttpClientEngine.kt:152)
       at io.ktor.client.engine.HttpClientEngine$install$1.invoke(HttpClientEngine.kt:15)
       at io.ktor.client.engine.HttpClientEngine$install$1.invoke(HttpClientEngine.kt:4)
       at io.ktor.util.pipeline.DebugPipelineContext.proceedLoop(DebugPipelineContext.kt:79)
       at io.ktor.util.pipeline.DebugPipelineContext.proceed(DebugPipelineContext.kt:54)
So far, caused 500 crashes over 90 days for 150 users
t
Are you using any other KMP library? It is possible that it might be pulling a different KTor version than what your project uses, this could result in a similar error. Never faced myself though...
s
Thanks @thedroiddiv 🙏 , first thing I checked.
./gradlew :app:dependencies
shows every
io.ktor:*
on a single version
(3.4.3)
, no
2.x/1.x mix
This
client.get
runs on ~every launch, but only 0.13% of sessions crash, but a real classpath conflict would be ~100%
ive also posted here