Rodrigo Munera
11/03/2023, 7:37 PMFailed to find HTTP client engine implementation in the classpath: consider adding client engine dependency .
My client looks like this:
private val client = HttpClient() {
        install(Logging)
        install(ContentNegotiation) {
            json(Json {
                prettyPrint = true
                isLenient = true
                ignoreUnknownKeys = true
            })
        }
    }
And my shared module (where my ktor code lives) looks like this (I'm using kotlin 1.9.20)
commonMain {
            dependencies {
                implementation(libs.ktor.client.core) // 2.3.5
                implementation(libs.kotlinx.serialization.json) // 1.6.0
                implementation(libs.kotlinx.coroutines.core) // 1.7.3
                implementation(libs.ktor.client.content.negotiation) // 2.3.5
                implementation(libs.ktor.serialization) // 2.3.5
                implementation(libs.ktor.logging) // 2.3.5
            }
        }
I didn't have an androidMain sourceSet defined so, one of the things I tried was to add one with the same dependencies as commonMain  (based on a thread from 3 years ago) but that didn't help the issue go away.
Is there a different place I should be adding the engine?
The reason I'm not specifying an engine in my HttpClient() declaration is because I just wanted to use the default engine, should I be using a different engine? I had a thread about a month ago where I was using CIO but that led to issues with my ios app not runninghfhbd
11/03/2023, 7:40 PMhfhbd
11/03/2023, 7:41 PMRodrigo Munera
11/03/2023, 7:43 PMapp dependencies? or still in my shared module?hfhbd
11/03/2023, 7:45 PMRodrigo Munera
11/03/2023, 7:45 PM