kosi-libs / MocKMP

A mocking processor for Kotlin Multiplatform
https://kosi-libs.org/mockmp
MIT License
183 stars 12 forks source link

MocKMP not generating mocks #45

Closed cbukenya closed 1 year ago

cbukenya commented 1 year ago

I had some issues that let MocKMP not to generate the mock classes for me.

java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.(org.jetbrains.kotlin.resolve.BindingContext, org.jetbrains.kotlin.codegen.ClassBuilderMode, java.lang.String, org.jetbrains.kotlin.config.LanguageVersionSettings, boolean, org.jetbrains.kotlin.config.JvmTarget, boolean, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1, int, kotlin.jvm.internal.DefaultConstructorMarker)'

work around, I set the plugin for ksp in the main build.gradle.kts gradle file, this forces MocKMP to use compatible ksp version, didn't want to go route of adding ksp directly like in your docs plugins { //trick: for the same plugin versions in all sub-modules

id("com.google.devtools.ksp") version "1.7.20-Beta-1.0.6"

}

after that it worked!

also this link was helpful https://github.com/google/ksp/issues/1050

SalomonBrys commented 1 year ago

This will be documented.