darkmoon_uk
06/09/2019, 1:30 AMkotlin.NoSuchElementException: List is empty
when initialising HttpClient
with JsonFeature
on iOS 🤔
Not sure what's going wrong here but I suspect I have the wrong dependencies for target iosMain
, being:
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-iosx64:$kotlin_coroutines_version")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$kotlin_serialization_version")
implementation("io.ktor:ktor-client-ios:$ktor_version")
implementation("io.ktor:ktor-client-json-iosx64:$ktor_version")
..it's hard to follow what the dependencies should be from Ktor documentation and examples. These don't seem to have kept pace with recent changes in meta-data driven identifiers and other refactoring.ribesg
06/09/2019, 7:57 AMimplementation("io.ktor:ktor-client-ios:${Versions.ktor}")
implementation("io.ktor:ktor-client-json-native:${Versions.ktor}")
implementation("io.ktor:ktor-client-serialization-native:${Versions.ktor}")
darkmoon_uk
06/10/2019, 10:23 AMktor-client-json-native
and unnecessarily fully specifying -iosx64
. That solved my issue 😄runBlocking
will block the only available thread... 🤔NSRunLoop
as a co-routine run-loop & scope...ribesg
06/10/2019, 10:50 AMdarkmoon_uk
06/10/2019, 11:12 AM