-
Notifications
You must be signed in to change notification settings - Fork 289
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
Upgrade from 1.14.2 to 1.15.1 causes "Caused by: java.lang.NoSuchMethodError: 'java.io.File com.squareup.kotlinpoet.FileSpec.writeTo(java.io.File)'" #1730
Comments
The exception names the newly added method in 1.5.0/1.5.1 (it returns |
Your plugin is only applied in the child Apply this change: diff --git PersianCalendar/build.gradle.kts PersianCalendar/build.gradle.kts
index 28f065a01..108388c5d 100644
--- PersianCalendar/build.gradle.kts
+++ PersianCalendar/build.gradle.kts
@@ -9,7 +9,7 @@ plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.androidx.navigation.safeargs.kotlin)
alias(libs.plugins.ksp)
- id("io.github.persiancalendar.appbuildplugin") apply true
+ id("io.github.persiancalendar.appbuildplugin")
}
val generatedAppSrcDir =
diff --git build.gradle.kts build.gradle.kts
index d0f79c9c5..8e2d45472 100644
--- build.gradle.kts
+++ build.gradle.kts
@@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.androidx.navigation.safeargs.kotlin) apply false
alias(libs.plugins.ksp) apply false
+ id("io.github.persiancalendar.appbuildplugin") apply false
}
task("clean") { You can verify the behavior change using the Before:
After:
|
…f it Patch provided by JakeWharton in square/kotlinpoet#1730 (comment) Fixes #1192
Thank you so much for the help and sorry for the plugin misconfiguration 🙏 Feel free to have a look at the app also, might have interesting things, it's a more or less popular fully offline non-profit and free local app 😊 |
As square/kotlinpoet#1730 (comment) "Remember, 100% of the plugins you use need to be specified in the root with apply false or else you'll get incredibly cryptic behavior."
…f it Patch provided by JakeWharton in square/kotlinpoet#1730 (comment) Fixes #1192
As square/kotlinpoet#1730 (comment) "Remember, 100% of the plugins you use need to be specified in the root with apply false or else you'll get incredibly cryptic behavior."
Describe the bug
Apparently an upgrade from 1.14.2 to 1.15.1 causes "Caused by: java.lang.NoSuchMethodError: 'java.io.File com.squareup.kotlinpoet.FileSpec.writeTo(java.io.File)'" as can be seen in https://github.com/persian-calendar/persian-calendar/actions/runs/6924586914/job/18834021299#step:6:70
To Reproduce
Build before and after this change proposed by dependabot persian-calendar/persian-calendar#1192 it's not a big project and doesn't have a network access so should be safe to build but I'll understand if you want a separate minimal project to reproduce the issue (while I believe this project isn't a hairy one also). It's weird just this change can cause a build failure without any indication on the solution.
Expected behavior
To work as before I think.
Additional context
Before filing this bug I saw #1476 which indicated something similar can happen because of ksp, while we also have an updated ksp but it isn't used yet for some reason so I even disabled it with no difference. Just to note that project has kotlin = "1.9.20" and ksp = "1.9.20-1.0.14", exactly as mentioned by KotlinPoet's 1.15.1 release note also.
I usually don't file such kind of reports and usually will try to resolve issues myself even on other projects but this felt weird so thought probably I can get some help, but I'll understand if you don't like it. Thanks
The text was updated successfully, but these errors were encountered: