I posted this over in ktor but in case people here...
# kotlin-native
h
I posted this over in ktor but in case people here may have an answer. I think I have a library version clash going on. I'm using coroutines 1.3.9-native-mt, serialization 1.0.0, and ktor version 1.4.0 or 1.4.1 running the SpaceXAPI code snippet but I get
Uncaught Kotlin exception: kotlin.IllegalStateException: Cannot execute task because event loop was shut down
with the CIO client explicitly selected when creating the HttpClient. It's code that works under the JVM though.
j
not a direct answer to your issue but I am using similar combinations of versions in https://github.com/joreilly/PeopleInSpace and https://github.com/joreilly/BikeShare if you want to compare. These are multiplatform projects but do include KN targets.
I did btw run in to following issue when using Ktor 1.4.1 - https://youtrack.jetbrains.com/issue/KTOR-1087
h
Thanks!
Yeah trying a combination of versions.
Drop into one of the RC's of serialization and the Json initialization stuff seemed to get wonky
j
there's certainly some constraints around how those versions can be combined
h
I know ktor has some single vs. multithreaded coroutine sensitivities but I thought this was the right combo for that
j
in PeopleInSpace for example I'm using
Copy code
const val kotlin = "1.4.10"
    const val kotlinCoroutines = "1.3.9-native-mt"
    const val ktor = "1.4.0"
    const val kotlinxSerialization = "1.0.0-RC"
btw note the
isForce
use in https://github.com/joreilly/PeopleInSpace/blob/master/common/build.gradle.kts ...not having this might be causing you issue
h
Yeah I tried that with
Copy code
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion") {
                    version {
                        strictly(coroutinesVersion)
                    }
                }
I'll try your way see if that fixes it
j
yeah,
strictly
is I think the more recommended approach and meant to change to use that....don't think it should behave differently to
isForce
h
yeah same effect
Further progress but hit wall, I think with ktor native. needed to do runBlocking(newSingleThreadContext) (default and unconstrained didn't work) but now CIO says TLS sessions aren't supported on native...well darn...
...Curl client works and doesn't have the coroutine event loop error problem...I'm wondering if that was a false trail...going to post final working code example once clean it up and blog about it.