Hi, i was wondering if ktor client-side was compat...
# ktor
s
Hi, i was wondering if ktor client-side was compatible with all api versions of android? I saw in the FAQ that ktor servers were only for android 27 and up, but i didn't see anything for ktor clients. I am asking because i have a connection "closed by peer" error on kitkat but works on other versions
e
Hi @Steven, what client engine do you use?
s
The default one
e
Could you list the dependency? 🙂
s
yes i am using: import io.ktor.client.HttpClient val client = HttpClient() client.get<String> { ... } Gradle Dependencies: commonMain: implementation("io.ktorktor client core$ktor_version") androidMain: implementation("io.ktorktor client android$ktor_version") iOSMain: implementation("io.ktorktor client ios$ktor_version") ktor_version = 1.1.4 kotlin version = 1.3.30
e
It could be an API difference in android. Could you try using
implementation("io.ktor:ktor-client-okhttp:$ktor_version")
to check?
s
ok i'll try
r
The newest versions of okhttp don't support kitkat anymore
You'd need to stick to 3.12.x instead of 3.14.x
not sure what ktor will pull in by default
s
After doing multiple tests, i have figured out that some of our api calls made in our servers refuses android kitkat (probably something about SSL certificates, we need to fix asap!).
Thank you very much for your time, sorry for wasting it.... but at least we know that ktor client-side works well 👍 (i have confirmed with working urls)