I’m having trouble using ktor http client 1.4.3 in...
# ktor
s
I’m having trouble using ktor http client 1.4.3 in the common layer. I can’t resolve the code in the IDE. Downgrading to 1.4.2 fixes it.
e
Hey, @spierce7. It can be affected by upgrading to
1.4.20
. Could you share the project configuration and compiler version?
e
It looks like you're still using platform dependencies. They are deprecated since
1.4.20
Could you specify common only dependencies in common source sets(except engines)?
s
How would I specify the okhttp client for android?
I actually didn’t even give you the build.gradle for the relevant module…
Copy code
val commonMain by getting {
            dependencies {
                implementation(Deps.kotlinx.coroutines.common)
                implementation(Deps.ktor.client.common)
                implementation(Deps.kotlinx.dateTime)
                implementation(Deps.kotlinx.serialization.json)
            }
        }
Copy code
val jvmMain by getting {
            dependencies {
                implementation(Deps.kotlinx.coroutines.jvm)
                implementation(Deps.ktor.client.jvm)
                implementation(Deps.okhttp)
                implementation(Deps.jsoup)
            }
        }
Deps.ktor.client.common
is
"io.ktor:ktor-client:${Versions.ktor}"
e
Yep, I see. Could you try
ktor-client-core
instead?
s
trying it now-
1.4.3
and
ktor-client-core
artifact in place for the common layer
@e5l That appears to work. I have to sync a few times for it to take though, which is suprising
@e5l Is this the solution you recommend I continue with?
e
Nope, it's a bug in kotlin-multiplatform
ktor-client
has
ktor-client-core
in common dependencies
Nothing changes here in Ktor, but it looks like it happened with
1.4.20
kotlin update
Sorry for the delay
Can I close the issue as obsolete?
s
So you are saying the issue should get fixed with the next bug release of Kotlin?
e
Not sure if the issue is known. Could you file the report?
Or we can switch subsystem of the origin issue(with fixing some details)