rharter / ktor-moshi

Ktor feature that adds Moshi JSON serialization support
Apache License 2.0
82 stars 6 forks source link

Fails on ktor 1.3.0 #7

Open gchallen opened 4 years ago

gchallen commented 4 years ago

ktor 1.3.0 has removed the kotlinx.io dependency, which causes this plugin to fail with class not found error:

intellijlogger_1  | java.lang.NoClassDefFoundError: kotlinx/coroutines/io/ByteReadChannel
intellijlogger_1  |     at com.ryanharter.ktor.moshi.MoshiConverter.convertForReceive(MoshiConverter.kt:22)
intellijlogger_1  |     at io.ktor.features.ContentNegotiation$Feature$install$3.invokeSuspend(ContentNegotiation.kt:154)
intellijlogger_1  |     at io.ktor.features.ContentNegotiation$Feature$install$3.invoke(ContentNegotiation.kt)

I assume that adding this as a dependency to ktor-moshi will fix this bug. But the fact that ktor has removed that dependency makes me wonder if there is a better way to do whatever the plugin is doing...?

ArthurSav commented 4 years ago

Until the PR is merged, you can use the patched version through jitpack


buildscript {
    repositories {
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.cs125-illinois:ktor-moshi:7252ca49ed'
}