Hixie
05/19/2020, 3:32 AMMilan Hruban
05/19/2020, 4:49 AMHixie
05/19/2020, 5:37 AMMilan Hruban
05/19/2020, 5:39 AMHixie
05/19/2020, 5:42 AMMilan Hruban
05/19/2020, 6:16 AMUgi
05/19/2020, 6:01 PMHixie
05/19/2020, 8:17 PMUgi
05/22/2020, 9:52 AM1.3.5-native-mt
version of coroutines, but I think non-native-mt version should work as well. and then in the code that needs to do the actual http call, I use
GlobalScope.launch(Dispatchers.Main) {
...
httpClient.get<ResponseModel>("https://...")
...
}
That should get you going, at the moment I'm using a callback to return the results. I'm certain there are better ways of doing this (for starters not just using GlobalScope), but I haven't had the time to get to it yet.Hixie
05/23/2020, 7:19 PMUgi
05/23/2020, 8:34 PMHixie
05/24/2020, 8:23 AMUgi
05/24/2020, 4:42 PMorg.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.5-native-mt
to
sourceSets["commonMain"].dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
implementation("io.ktor:ktor-client-core:$ktor_version")
}
and implementation org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.5-native-mt
and implementation("io.ktor:ktor-client-ios:1.3.5-native-mt)
to
sourceSets["iosMain"].dependencies {
implementation("io.ktor:ktor-client-ios:$ktor_version")
}
I haven't tried compiling it, but maybe it will work :)Hixie
05/24/2020, 8:18 PMUncaught Kotlin exception: kotlinx.coroutines.CoroutinesInternalError: Fatal exception in coroutines machinery for DispatchedContinuation[WorkerCoroutineDispatcherImpl@25429a8, Continuation @ $connect$lambda-2COROUTINE$1]. Please read KDoc to 'handleFatalException' method and report this incident to maintainers
followed by a stack trace all in the kotlin libs followed by
Caused by: kotlin.ClassCastException: kotlin.coroutines.native.internal.CompletedContinuation cannot be cast to kotlinx.coroutines.DispatchedContinuation
...followed by another stack also all in the kotlin libsUgi
05/26/2020, 7:30 AMHixie
05/26/2020, 7:52 PM