Unknown error in kotlin compiler
See original GitHub issueWhen using custom ksp-based annotation processor, I encountered this exception:
> Task :my-module:kspDebugKotlin FAILED
e: java.lang.IllegalStateException: Should not be called!
at org.jetbrains.kotlin.types.ErrorUtils$1.getPackage(ErrorUtils.java:94)
at org.jetbrains.kotlin.descriptors.DescriptorUtilKt.resolveClassByFqName(descriptorUtil.kt:24)
at org.jetbrains.kotlin.resolve.checkers.ExperimentalUsageChecker$Companion.checkCompilerArguments$checkAnnotation(ExperimentalUsageChecker.kt:340)
at org.jetbrains.kotlin.resolve.checkers.ExperimentalUsageChecker$Companion.checkCompilerArguments(ExperimentalUsageChecker.kt:363)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:114)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:253)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.repeatAnalysisIfNeeded(KotlinToJVMBytecodeCompiler.kt:223)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:100)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:58)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:170)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1618)
...
It occurred after I updated ksp from 1.5.21-beta07
to 1.6.0-1.0.2
. I don’t even know how to approach debugging this issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top Results From Across the Web
Unknown error in kotlin online editors - Support
I'm getting this errors. Does anyone know what they are about ? Exception in thread “main” java.io.
Read more >compileDebugKotlin resulting StackOverflowError with ...
I'm running to an annoying problem in one of my android studio project, this gradle problem is intermitten, I can't tell which part...
Read more >Internal Error: Unknown version of LookupSymbolKeyDescriptor
It looks like one of the problems with broken incremental caches in Kotlin (a bunch of them were fixed in release). One other...
Read more >Known issues with Android Studio and Android Gradle Plugin
Running JUnit tests may compile the code twice · To fix the issue for the current project, click Run > Edit Configurations and...
Read more >How to handle 'unknown' unchecked exceptions. : r/Kotlin
First, checked exceptions are checked only by the compiler so any method can throw any exception anyway. How often have you encountered Java ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ting-yuan I can’t reproduce a minimum project, so I uploaded the project that encountered the bug.
Reproduction:
https://github.com/RinOrz/ksp-issue797/
KSP Part:
https://github.com/RinOrz/ksp-issue797/blob/master/compiler-base/ksp/src/main/kotlin/MetaPluginProcessorProvider.kt
Possible error part:
https://github.com/RinOrz/ksp-issue797/blob/master/compiler-base/ksp/src/main/kotlin/Utils.kt#L57 https://github.com/RinOrz/ksp-issue797/blob/master/compiler-base/ksp/src/main/kotlin/Utils.kt#L73
Exception:
https://github.com/RinOrz/ksp-issue797/runs/5083336430?check_suite_focus=true#step:4:289
Yes, that should make the error message away. BTW, 1.6.10-1.0.3 which contains the fix is also released 😃