-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to upgrade to Kotlin 1.9 #1445
Comments
Would you mind sharing a small reproducible test case? |
I am not sure if this is caused by KSP and Dataframe. Add this to resolve our problem, our project used Kotlin Dataframe1 which used Ksp in Dataframe codegen plugin. tasks.whenTaskAdded {
if (name == "kaptGenerateStubsKotlin") {
dependsOn("kspKotlin")
}
if (name == "kaptTestKotlin") {
dependsOn("kspTestKotlin")
}
//...
} Footnotes |
+1 same here |
+1 same here. We have multimodule android project. We use kapt and ksp at same time. Maybe you could provide a temporary workaround to fix this issue? Thanks in advance! @ting-yuan |
Temporary workaround which worked for us. If you use convention plugin: pluginManager.withPlugin("com.google.devtools.ksp") {
tasks.configureEach {
if (name == "kaptGenerateStubsKotlin") {
dependsOn("kspKotlin")
}
if (name == "kaptKotlin") {
dependsOn("kspKotlin")
}
}
} If you don't use convention plugin, that works too. Add at the end of build.gradle.(kts) file: tasks.configureEach {
if (name == "kaptGenerateStubsKotlin") {
dependsOn("kspKotlin")
}
if (name == "kaptKotlin") {
dependsOn("kspKotlin")
}
} |
@Enaium @uladzislau-hryshechka can you provide mode details on how your project is configured? From @hantsy 's case, it does seem like applying dataframe added a dependency since dataframe generates code with KSP that might be taken as input to KAPT. |
+1 experiencing the same in our project. Same workaround resolved this for us. |
https://github.com/babyfish-ct/jimmer/tree/main/example/kotlin/jimmer-sql-kt
|
We have multimodule android project. Structure of this project:
Some modules could include ksp, kapt, both or nothing of that. It depends. Classical type of plugins which we use (for example android library):
|
I don't think this is a bug per-se, rather a side effect of kapt tasks no longer being eagerly initialized. I think the right solution would be for KSP to offer an API to add this dependency at the Gradle level. Perhaps something like this? Or a gradle property? ksp {
makeKaptTasksDependOnKspTasks()
} Where things get tricky are matching variants and KMP jvm source sets, but I think it'd be worthwhile to do. |
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. |
But it still has problems after run the |
Do you mean that, after removing that block / workaround and doing a clean build, the problem remains? If so, could you provide a sample project so that we can investigate? |
I don't have the |
I solved the issue. The kapt plugin must be declared after the ksp plugin. plugins {
kotlin("jvm") version "1.9.0"
-kotlin("kapt") version "1.9.0"
id("com.google.devtools.ksp") version "1.9.0-1.0.12"
+kotlin("kapt") version "1.9.0"
} |
…wrappers Also fixed encountered issues: * spring-projects/spring-security#13568 * gradle/gradle#20132 * google/ksp#1445 `BeeFetchedTest` now uses updated DGS generate client V2 API.
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 |
you can try KSP 1.9.10-1.0.13 |
Thanks @neetopia 🙌🙌 |
Maybe my comment could help you: #963 (comment) |
I updated my project to Kotlin 1.9.0 and Gradle 8.2, and got the following build info.
Add the following in the
build.gradle.kts
, did not resolve the issue.The text was updated successfully, but these errors were encountered: