Skip to content
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

java.lang.NoSuchMethodError: 'java.io.OutputStream com.google.devtools.ksp.processing.CodeGenerator.createNewFile$default(com.google.devtools.ksp.processing.CodeGenerator, com.google.devtools.ksp.processing.Dependencies, java.lang.String, java.lang.String, java.lang.String, int, java.lang.Object)' #1476

Closed
kakinIA opened this issue Feb 14, 2023 · 3 comments
Labels

Comments

@kakinIA
Copy link

kakinIA commented Feb 14, 2023

it was happened in using ksp

public fun FileSpec.writeTo(
  codeGenerator: CodeGenerator,
  dependencies: Dependencies
)

the exception stack is

java.lang.NoSuchMethodError: 'java.io.OutputStream com.google.devtools.ksp.processing.CodeGenerator.createNewFile$default(com.google.devtools.ksp.processing.CodeGenerator, com.google.devtools.ksp.processing.Dependencies, java.lang.String, java.lang.String, java.lang.String, int, java.lang.Object)'
	at com.squareup.kotlinpoet.ksp.OriginatingKSFilesKt.writeTo(originatingKSFiles.kt:128)

kotlin version: 1.6.21
ksp version: 1.6.21-1.0.5
kotlinpoet version: 1.12.0
gradle: 7.2

Are the versions not suitable?

@kakinIA kakinIA added the bug label Feb 14, 2023
@ZacSweers
Copy link
Collaborator

1.12.0 is built against KSP 1.7.0-1.0.6. You should update your tools.

@ZacSweers ZacSweers closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2023
@kakinIA
Copy link
Author

kakinIA commented Feb 14, 2023

Thanks, it also can downgrade to 1.11.0.

@Nobler
Copy link

Nobler commented Mar 23, 2023

1.12.0 is built against KSP 1.7.0-1.0.6. You should update your tools.

Could please provide some mechanisms to check the version of ksp that kotlinpoet depending?
ksp can provide some message like this

ksp-a.b.c is too old for kotlin-x.y.z. Please upgrade ksp or downgrade kotlin-gradle-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants