google / ksp

Kotlin Symbol Processing API
https://github.com/google/ksp
Apache License 2.0
2.87k stars 272 forks source link

java.lang.NoSuchMethodError: 'java.util.List org.jetbrains.kotlin.load.java.JvmAnnotationNamesKt.getNOT_NULL_ANNOTATIONS()' #1980

Open AkhilTMohan opened 4 months ago

AkhilTMohan commented 4 months ago

kotlin.android: 1.9.24 or 2.0.20-Beta1 checked both Devtools KSP: 2.0.0-1.0.22 Java version 17

hilt version: 2.51.1

Complete Error Log

java.lang.NoSuchMethodError: 'java.util.List org.jetbrains.kotlin.load.java.JvmAnnotationNamesKt.getNOT_NULL_ANNOTATIONS()' at com.google.devtools.ksp.symbol.impl.java.KSTypeReferenceJavaImpl.resolve(KSTypeReferenceJavaImpl.kt:134) at com.google.devtools.ksp.visitor.KSValidateVisitor.visitTypeReference(KSValidateVisitor.kt:57) at com.google.devtools.ksp.visitor.KSValidateVisitor.visitTypeReference(KSValidateVisitor.kt:5) at com.google.devtools.ksp.symbol.impl.java.KSTypeReferenceJavaImpl.accept(KSTypeReferenceJavaImpl.kt:144) at com.google.devtools.ksp.visitor.KSValidateVisitor.visitClassDeclaration(KSValidateVisitor.kt:64) at com.google.devtools.ksp.visitor.KSValidateVisitor.visitClassDeclaration(KSValidateVisitor.kt:5) at com.google.devtools.ksp.symbol.impl.java.KSClassDeclarationJavaImpl.accept(KSClassDeclarationJavaImpl.kt:166) at com.google.devtools.ksp.UtilsKt.validate(utils.kt:125) at com.google.devtools.ksp.UtilsKt.validate$default(utils.kt:124) at androidx.room.compiler.processing.ksp.KspElement.validate(KspElement.kt:65) at androidx.room.processor.PojoProcessor.doProcess(PojoProcessor.kt:120) at androidx.room.processor.PojoProcessor.access$doProcess(PojoProcessor.kt:56) at androidx.room.processor.PojoProcessor$process$1.invoke(PojoProcessor.kt:112) at androidx.room.processor.PojoProcessor$process$1.invoke(PojoProcessor.kt:109) at androidx.room.processor.cache.Cache$Bucket.get(Cache.kt:53) at androidx.room.processor.PojoProcessor.process(PojoProcessor.kt:109) at androidx.room.processor.TableEntityProcessor.doProcess(TableEntityProcessor.kt:93) at androidx.room.processor.TableEntityProcessor.access$doProcess(TableEntityProcessor.kt:44) at androidx.room.processor.TableEntityProcessor$process$1.invoke(TableEntityProcessor.kt:53) at androidx.room.processor.TableEntityProcessor$process$1.invoke(TableEntityProcessor.kt:52) at androidx.room.processor.cache.Cache$Bucket.get(Cache.kt:53) at androidx.room.processor.TableEntityProcessor.process(TableEntityProcessor.kt:52) at androidx.room.processor.DatabaseProcessor.processEntities(DatabaseProcessor.kt:468) at androidx.room.processor.DatabaseProcessor.doProcess(DatabaseProcessor.kt:69) at androidx.room.processor.DatabaseProcessor.process(DatabaseProcessor.kt:60) at androidx.room.DatabaseProcessingStep$process$databases$1$1.invoke(DatabaseProcessingStep.kt:68) at androidx.room.DatabaseProcessingStep$process$databases$1$1.invoke(DatabaseProcessingStep.kt:64) at androidx.room.processor.Context.collectLogs(Context.kt:192) at androidx.room.DatabaseProcessingStep.process(DatabaseProcessingStep.kt:64) at androidx.room.compiler.processing.CommonProcessorDelegate.processRound(XBasicAnnotationProcessor.kt:130) at androidx.room.compiler.processing.ksp.KspBasicAnnotationProcessor.process(KspBasicAnnotationProcessor.kt:62) at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:310) at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:308) at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:414) at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:308) at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:112) at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:75) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze$lambda$12(KotlinToJVMBytecodeCompiler.kt:373) at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:112) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:364) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.runFrontendAndGenerateIrUsingClassicFrontend(KotlinToJVMBytecodeCompiler.kt:195) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:106) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:170) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:43) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:106) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:50) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101) at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1556) at jdk.internal.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source) at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source) at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.rmi/sun.rmi.transport.Transport.serviceCall(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source) at java.base/java.security.AccessController.doPrivileged(Unknown Source) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

nisrulz commented 2 months ago

To fix this, simply update to Kotlin version: 2.0.20.

KSP v2.0.20-1.0.24 depends on Kotlin version 2.0.20 in this particular release case.