I am trying to use kotlinx serialization and I am ...
# announcements
s
I am trying to use kotlinx serialization and I am working with the outlined basic example 3 in the kotlinx.serialization project. I am using Kotlin 1.4.31 and kotlinx.serialization 1.1.0. I am getting the attatched error even though I set up the test just like the example in the kotlinx.serialization code. Any thoughts on what I could be doing wrong? Or is this just a product of it still being in an experimental state.
j
Maybe having two data classes with the same name and properties?
s
Good thought. Still have the same issue though. I tried to downgrade the Kotlin version and kotlinx serialization version as well and I still have the same issue.
I am just going to build a project from scratch and see if I can get it to work...
d
NoSuchMethod errors generally imply classpath issues -> referencing version X but actually picking up version Y Check your classpath whether you got some conflicting lib versions there
s
Yeah, it definitely works in a new project. The dependencies looked the same in the new project as the old project from the gradle file and the dependency tree:
left is new project and right is old project... Not really sure what the issue is, but I think I can maybe work past it now. Thanks for helping.
In case anyone was curious... Adding this dependency breaks it:
Copy code
implementation("com.github.polygon-io:client-jvm:1.1.1")
And that is because they consequently attempt to bring in an older version of kotlin serialization: classpath("org.jetbrains.kotlinkotlin serialization1.3.61")
a
Ah, the Maven coordinates changed so Gradle just sees it as a distinct library; presumably the jvm package names didn’t