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

Thomas

05/16/2019, 4:05 PM
After updating to Ktor
1.2.0
I keep getting this error (on Android). I have no idea what this error means. Ktor
1.2.0-alpha-1.3.0-eap-125
works fine and
1.2.0-rc
gives the error as well. One of these commit probably broke my app: https://github.com/ktorio/ktor/compare/1.2.0-alpha-1.3.0-eap-125...1.2.0-rc. Could someone help me out please?
c

cy

05/17/2019, 7:23 AM
Any repro? What exactly are you doing?
t

Thomas

05/17/2019, 7:34 AM
@cy I don't have a repro yet. I'm doing
client.get<ByteReadChannel>
and this exception occurs somewhere when reading the
ByteReadChannel
. I'll check if I can reproduce it in another project. All was fine before upgrading.
I attached a sample project. Run the app and it will throw the exception. This issue is currently preventing me from updating to Ktor
1.2.0
. Thanks for your help @cy
This is the code in the sample project:
Copy code
GlobalScope.launch {
    val client = HttpClient(OkHttp)
    val channel = client.get<ByteReadChannel> {
        url("<https://kotlinlang.org/>")
    }
    channel.readRemaining()
}
2 Views