Skip to content
Latchkey

Kotlin KSP symbol processing produced no output / failed in CI

KSP processors are tied to a Kotlin version: the KSP Gradle plugin version encodes the Kotlin version it supports (for example 2.0.21-1.0.28). A mismatch, or a processor added with the wrong configuration, makes kspKotlin fail or emit no generated code, and dependent references become unresolved.

What this error means

A :app:kspKotlin (or :app:kspDebugKotlin) task fails with a KSP version message, or the build later fails with "Unresolved reference" for a class the processor should have generated.

Kotlin
> Task :app:kspDebugKotlin FAILED
ksp-2.0.0-1.0.21 is too old for kotlin-2.0.21. Please upgrade ksp or downgrade kotlin.

Common causes

KSP plugin version does not match the Kotlin version

The KSP version prefix must match the Kotlin compiler version. A stale KSP plugin refuses to run against a newer Kotlin resolved in CI.

The processor is on the wrong configuration

A symbol processor added with implementation instead of ksp(...) never registers, so no code is generated.

How to fix it

Align the KSP version with Kotlin

  1. Match the KSP plugin version prefix to your Kotlin version.
  2. Add each processor via the ksp(...) configuration.
  3. Run a clean build so generated sources are produced.
build.gradle.kts
plugins {
    kotlin("jvm") version "2.0.21"
    id("com.google.devtools.ksp") version "2.0.21-1.0.28"
}
dependencies {
    ksp("io.moshi:moshi-kotlin-codegen:1.15.1")
}

Verify the KSP task actually runs

Run the ksp task explicitly with info logging to confirm it registers and generates output.

Terminal
./gradlew clean :app:kspDebugKotlin --info

How to prevent it

  • Bump the KSP plugin whenever you bump Kotlin, keeping the version prefix in sync.
  • Declare symbol processors with the ksp configuration only.
  • Use a version catalog so Kotlin and KSP versions move together.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →