ksp: Failed to upgrade to Kotlin 1.9
I updated my project to Kotlin 1.9.0 and Gradle 8.2, and got the following build info.
A problem was found with the configuration of task ':kaptGenerateStubsKotlin' (type 'KaptGenerateStubsTask').
- Gradle detected a problem with the following location: 'D:\FreelanceProjects\sami\etip-backend\build\generated\ksp\main\kotlin'.
Reason: Task ':kaptGenerateStubsKotlin' uses this output of task ':kspKotlin' without declaring an explicit or implicit dependency. This can lead to incorrect results being produce
d, depending on what order the tasks are executed.
Possible solutions:
1. Declare task ':kspKotlin' as an input of ':kaptGenerateStubsKotlin'.
2. Declare an explicit dependency on ':kspKotlin' from ':kaptGenerateStubsKotlin' using Task#dependsOn.
Add the following in the build.gradle.kts
, did not resolve the issue.
tasks.named("kaptGenerateStubsKotlin"){
dependsOn("kspKotlin")
}
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 8
- Comments: 19 (1 by maintainers)
Commits related to this issue
- Workaround for bug in KSP https://github.com/google/ksp/issues/1445 — committed to GisoBartels/kaster by GisoBartels a year ago
- Bumped kotlin, ksp, spring, dgs, hibernate versions & updated gradle wrappers Also fixed encountered issues: * https://github.com/spring-projects/spring-security/issues/13568 * https://github.com/grad... — committed to bee-produced/bee-built by kurbaniec 8 months ago
I solved the issue.
The kapt plugin must be declared after the ksp plugin.
you can try KSP 1.9.10-1.0.13
I got this warning in upgrading to kotlin 1.9.10
ksp-1.8.10-1.0.9 is too old for kotlin-1.9.10. Please upgrade ksp or downgrade kotlin-gradle-plugin to 1.8.10.
is there any ksp version that is compatible with the kotlin 1.9.10
I guess some of the issues come from a previous workaround which lets IDE be aware of generated source:
KSP has been doing this automatically, with dependencies correctly set up since 1.0.9. If you have this workaround in your build script, please try to remove it and see if the problem remains.
https://github.com/babyfish-ct/jimmer/tree/main/example/kotlin/jimmer-sql-kt