https://kotlinlang.org logo
#ktor
Title
# ktor
s

spierce7

12/07/2020, 3:44 AM
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

e5l

12/07/2020, 8:04 AM
Hey, @spierce7. It can be affected by upgrading to
1.4.20
. Could you share the project configuration and compiler version?
e

e5l

12/07/2020, 2:05 PM
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

spierce7

12/07/2020, 2:55 PM
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

e5l

12/07/2020, 2:57 PM
Yep, I see. Could you try
ktor-client-core
instead?
s

spierce7

12/07/2020, 2:58 PM
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

e5l

12/07/2020, 4:31 PM
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

spierce7

12/07/2020, 4:52 PM
So you are saying the issue should get fixed with the next bug release of Kotlin?
e

e5l

12/07/2020, 4:52 PM
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)