Skip to content

KSP doesn’t work when using a settings plugin. #2723

@vinvince

Description

@vinvince

I recently ran into an issue where after upgrading the Android Gradle Plugin from 8.9.3 to 8.13.1, the KSP plugin stopped working. After some digging, I found it’s related to my custom settings plugin. KSP only starts working again in these two cases:

  • Keep my settings plugin, but downgrade Android Gradle Plugin from 8.13.1 back to 8.9.3
  • Keep Android Gradle Plugin 8.13.1, but remove my settings plugin from the project

My settings plugin likes:

class TestSettingsPlugin : Plugin<Settings> {
    override fun apply(target: Settings) {
        print("Test for settings plugin.")
    }
}

From these two cases, it looks like KSP may be clashing with my settings plugin (the one that extends Plugin<Settings>). Here are the versions I’m using:

  • Android Gradle Plugin: 8.13.1
  • Kotlin: 2.2.21
  • KSP: 2.3.3

Error message shows:

Task :app:kspDebugKotlin SKIPPED
Skipping task ':app:kspDebugKotlin' as task onlyIf 'Task satisfies onlyIf spec' is false.
Resolve mutations for :app:compileDebugKotlin (Thread[#647,Execution worker,5,main]) started.
:app:compileDebugKotlin (Thread[#647,Execution worker,5,main]) started.

I’ve put together a minimal repo to reproduce the issue — please fix it:

https://github.com/vinvince/KspTest/tree/develop

Metadata

Metadata

Assignees

Labels

GradleIssues with KSP Gradle Plugin, AGP or Gradle.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions