komputing / ipfs-api-kotlin

IPFS API for kotlin to access a IPFS node via http
http://ipfs.io
91 stars 19 forks source link

Moshi problem #35

Open kingsleyh opened 2 years ago

kingsleyh commented 2 years ago

Hey

having a moshi issue

in my build.gradle I was already using this:

    // Kotlin KSP support
    id("com.google.devtools.ksp") version "1.6.20-1.0.4"

    // Json
    implementation("com.squareup.moshi:moshi:1.13.0")
    implementation("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.6.20-1.0.4")
    ksp("com.squareup.moshi:moshi-kotlin-codegen:1.13.0")

    // IPFS
    implementation("com.github.ligi:ipfs-api-kotlin:0.15")

Any idea how to solve this now I tried to add ipfs-api-kotlin?

 val multiHash = LocalIPFS().add.string("hello").Hash
  println(multiHash)
Cannot serialize Kotlin type io.ipfs.kotlin.model.NamedHash. Reflective serialization of Kotlin classes without using kotlin-reflect has undefined and unexpected behavior. Please use KotlinJsonAdapterFactory from the moshi-kotlin artifact or use code gen from the moshi-kotlin-codegen artifact.