question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unknown error in kotlin compiler

See original GitHub issue

When 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:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found