Hi, is there a Ktor client dependency that I can a...
# ktor
g
Hi, is there a Ktor client dependency that I can add to commanMain and support all targets? I tried to add CIO but fails for native targets
Copy code
Caused by: org.gradle.internal.component.NoMatchingConfigurationSelectionException: No matching variant of io.ktor:ktor-client-cio:2.3.3 was found. The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'mingw_x64' but:
Docs say to add Darwin, curl, okhttp to specific targets, but Im lazy to add them manually
a
g
they only mention platform specific code. I wanted a library to add to common mainc, wich will handle all platforms. Currently I have to add Android, Windows, Macos client libraries manually in Gradle
j
You can use all dependency of ktor client in commonMain but you need to add engine based on each platform. Because cio doesn't support js target and vice versa