3

im in the process of upgrading from Moshi 1.8 to 1.9.1. My Data classes are annotated to generate the Adapter:

@JsonClass(generateAdapter = true)
data class VersionControlResponse(
         val versions: List<ItemResponse>
) { ... }

I wrote a simple unit test to verify if i can get it to work, but i end up with this Exception:

java.lang.NoSuchMethodException: de.packagename.versioncontrol.VersionControlResponse$ItemResponse.<init>(java.lang.String, boolean, long, long, int, java.lang.String, java.util.List, int, kotlin.jvm.internal.DefaultConstructorMarker)

My Test succeed using 1.8 with 1.9.1 i get trace above.

i read in the documentation that i need to provide the kotlin std-lib, i do so aswel:

implementation (remoteDependencies.moshi) {
    exclude group: 'org.jetbrains.kotlin', module: 'kotlin-reflect'
}
implementation remoteDependencies.moshiConverter
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:1.3.50"
kapt remoteDependencies.moshiCodeGen

Does someone can help me out why it cant find the constructor of that class ?

thx

Kitesurfer
  • 3,438
  • 2
  • 29
  • 47

0 Answers0