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

John O'Reilly

08/21/2020, 6:18 PM
Is there any way right now to use Ktor 1.4 with Kotlin/Native? https://youtrack.jetbrains.com/issue/KTOR-915 seems to indicate you can work around by forcing use of
1.3.8-native-mt-1.4.0-rc
of kotlinx coroutines but that's not working for me here at least.
r

russhwolf

08/21/2020, 6:54 PM
I was able to get a bare-bones call working if I use
1.3.9-native-mt
and don't use
Logger
.
j

John O'Reilly

08/21/2020, 7:00 PM
thanks @russhwolf , that worked for me here as well.....just curious....how did you determine that was related?
r

russhwolf

08/21/2020, 7:03 PM
I was trying to update https://github.com/russhwolf/multiplatform-hello last night. Started trying to pare different things down when I saw it wasn't working
Didn't merge yet, but if you want to play around, the
1.4.0
branch fails the api client test and crashes when running the app, but the
1.4.0-workarounds
branch works
This weekend I want to throw up a minimal sample of the logger issue and log a ticket since that part isn't captured by the existing tickets
👍 1
🙏 1
j

John O'Reilly

08/21/2020, 7:34 PM
It's strange.....with logging removed some of my queries aren't returning any results....I'm using http://api.citybik.es/v2/ and it works for some cities and not others (but works for all if logging is enabled!)
but of course without logging it's hard to know what's going on 🙂
😬 1
just to confuse matters....this is only an issue on Android....works fine (without logging) on iOS and macOS
(am now btw using CIO for all platforms, other than JS)
r

russhwolf

08/21/2020, 7:51 PM
I haven't touched CIO yet. Since it's apparently Http-only right now, your issue could be around Android trying to enforce https.
j

John O'Reilly

08/21/2020, 7:52 PM
I had to switch to http endpoint for that reason
seemingly native-mt stuff only works with CIO
replace 10.0.2.2 with the domain you're trying to hit
j

John O'Reilly

08/21/2020, 7:54 PM
it is working (on Android) for some of the http requests though (and all of them as mentioned if I enable logging)
fwiw changes now pushed to https://github.com/joreilly/BikeShare
r

russhwolf

08/21/2020, 7:55 PM
oh yeah in that case 🤷
j

John O'Reilly

08/21/2020, 9:45 PM
@russhwolf hmm, so what I had above was with Android also using CIO.....if I go back to Android using default (based on having
io.ktor:ktor-client-android
dependency) then I do need that security config. Do you know if that's a new requirement.....had thought I'd been connecting to http endpoints previously without needing that?
r

russhwolf

08/21/2020, 9:46 PM
I think it’s a couple years back
I haven’t looked at those docs in a while
j

John O'Reilly

08/21/2020, 9:53 PM
ah, just looked at https://github.com/joreilly/PeopleInSpace again (which uses http endpoint) and see that I'm using
android:usesCleartextTraffic="true"
for that
r

russhwolf

08/21/2020, 9:54 PM
Oh maybe that’s better and I just keep copy/pasting the same old config without knowing about it
j

John O'Reilly

08/21/2020, 9:55 PM
not sure tbh....hadn't even remembered adding that in there 🙂
those last set of updates have been merged to BikeShare repo now