Is there a way to fix “unresolved reference” error...
# kotlin-inject
k
Is there a way to fix “unresolved reference” errors in IDE in a KMP project? The code compiles fine 🤔
I have this build configuration:
Copy code
kotlin {
  targets.configureEach {
    if (targetName != "metadata") {
      dependencies {
        add("ksp${targetName.capitalize()}", libs.kmp.kotlin.inject.compiler)
      }
    }

    compilations.configureEach {
      kotlinSourceSets.forEach { sourceSet ->
        sourceSet.kotlin.srcDir("$buildDir/generated/ksp/$targetName/${sourceSet.name}/kotlin")
      }
    }
  }
  // ...
}
l
Are you seeing this issue within an iOS target?
k
Within
commonMain
e
The latest version of KSP hopefully fixed this issue (I haven't tested it yet)