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
Giorgi
08/20/2023, 4:24 PM
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:
Giorgi
08/20/2023, 4:24 PM
Docs say to add Darwin, curl, okhttp to specific targets, but Im lazy to add them manually
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
jamshedalamqaderi
08/21/2023, 5:06 AM
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