Skip to content

KSP 2.3.11 causes implicit task dependency failures in Android-KMP host-test lint tasks #3128

Description

@alyssoncs

Description

Summary

Upgrading KSP from 2.3.10 to 2.3.11 breaks check in an Android-KMP library using the standalone lint plugin.

The Android host-test lint tasks consume output directories from kspAndroidHostTest without declaring a dependency on that task.

Reproducer

https://github.com/alyssoncs/KspBug

The repository contains two independent, source-identical modules. Their build files differ only by the KSP version.

./gradlew :previous:check # KSP 2.3.10: passes
./gradlew :latest:check   # KSP 2.3.11: fails

Actual behavior

> Task :latest:generateAndroidHostTestLintModel FAILED
> Task :latest:lintAnalyzeAndroidHostTest FAILED

Task ':latest:lintAnalyzeAndroidHostTest' uses this output of task
':latest:kspAndroidHostTest' without declaring an explicit or implicit dependency:

latest/build/generated/ksp/android/androidHostTest/kotlin
latest/build/generated/ksp/android/androidHostTest/java

Task ':latest:generateAndroidHostTestLintModel' reports the same problem.

Expected behavior

Applying KSP must not produce an invalid Gradle task graph.  check  should pass as it does with KSP 2.3.10.

Environment

- KSP: 2.3.10 passes; 2.3.11 fails
- Kotlin: 2.4.10
- Android Gradle Plugin: 9.3.1
- Gradle: 9.7.0
- Plugins:
 -  org.jetbrains.kotlin.multiplatform 
 -  com.android.kotlin.multiplatform.library 
 -  com.android.lint 

Additional findings

- No symbol processor dependency is required to reproduce the failure. This is intentional:  androidHostTest  has an empty processor classpath, which is a valid target-specific KSP configuration.
-  com.android.lint  is load-bearing because the Android-KMP library plugin does not add lint verification to  check  by itself.
- The equivalent project using normal  com.android.library  passes  check  with both KSP 2.3.10 and 2.3.11. The regression appears specific to Android-KMP host-test lint integration.
- KSP 2.3.11 changed empty-processor tasks to execute cleanup instead of being skipped as part of #3046. That change appears to expose the missing task dependency.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GradleIssues with KSP Gradle Plugin, AGP or Gradle.P2affects usability but not blocks usersbugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions