Skip to content

KSP Gradle Plugin failed with Screenshot Preview Testing Plugin since 2.0.3 #2643

@ganadist

Description

@ganadist

Build Environment

  • Gradle 9.0.0
  • AGP 9.0.0-alpha10
    • Builtin Kotlin plugin was disabled
  • Kotlin 2.2.20
  • KSP 2.0.4
  • Screenshot Preview Testing Plugin 0.0.1-alpha11

Reproducible example

$ git clone https://github.com/ganadist/minimal-reproducible-example -b ksp2_screenshot_testing

$ cd minimal-reproducible-example
  • Perform build with KSP 2.0.2 with Compose Screenshot Preview Plugin-> Ok
$ ./gradlew :lib:hostconfig:assembleDebug -PkspVersion=2.0.2

> Task :lib:hostconfig:assembleDebug

BUILD SUCCESSFUL in 4s

Publishing Build Scan...
https://gradle.com/s/imgzfzg4cndvs
  • Perform build with KSP 2.0.4 with Compose Screenshot Preview Plugin -> Fail
$ ./gradlew :lib:hostconfig:assembleDebug -PkspVersion=2.0.4

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':lib:hostconfig'.
> java.lang.RuntimeException: KSP is not compatible with Android Gradle Plugin's built-in Kotlin. 
  Please disable by adding android.builtInKotlin=false to gradle.properties and apply kotlin("android") plugin

Publishing Build Scan...
https://gradle.com/s/dm5xrx7euejp4
  • Removed Compose Screenshot Preview Testing plugin with KSP 2.0.4 -> Ok
$ git checkout HEAD~1

$ ./gradlew :lib:hostconfig:assembleDebug -PkspVersion=2.0.4

> Task :lib:hostconfig:assembleDebug

BUILD SUCCESSFUL in 1s

Publishing Build Scan...
https://gradle.com/s/sx6xcmql3jdr6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions