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

aleksey.tomin

08/15/2020, 6:54 AM
I’ve splitted HttpClient to common and macos part. It works in 1.3.2 - https://github.com/alekseytomin/test-curl I try to migrate on 1.3.2-1.4.0-rc - https://github.com/alekseytomin/test-curl/pull/1 After this I can’t split code to common and native
Copy code
$ ./gradlew build
...
> Task :sdk:compileCommonMainKotlinMetadata FAILED
e: java.lang.IllegalStateException: e: Failed to resolve Kotlin library: .../test-curl/sdk/build/kotlinSourceSetMetadata/commonMain/io.ktor-ktor-client-curl-metadata/io.ktor-ktor-client-curl-metadata-libcurlInterop.klib
        at org.jetbrains.kotlin.library.SingleFileResolveKt$resolveSingleFileKlib$1.error(SingleFileResolve.kt:19)
        at org.jetbrains.kotlin.library.SingleFileResolveKt$resolveSingleFileKlib$1.error(SingleFileResolve.kt:17)
......

$ ls sdk/build/kotlinSourceSetMetadata/commonMain/io.ktor-ktor-client-curl-metadata/io.ktor-ktor-client-curl-metadata-libcurlInterop.klib
If I move RestApi from common to native part all ok - https://github.com/alekseytomin/test-curl/pull/2 - but I want to reuse this code in native (with curl) and android (OkHttp) parts. How can I use HttpClient in common part and create this in native/android?