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.

KSP plugin works fine when compiling with gradle but fails when compiling with Intellij IDEA

See original GitHub issue

The very simple project here demonstrates the issue:

https://github.com/aduchate/kmap-test

When compiled using gradle, everything goes fine but when compiled using IntelliJ, the following error occurs

Kotlin: [Internal Error] java.lang.IllegalStateException: The provided plugin com.google.devtools.ksp.KotlinSymbolProcessingComponentRegistrar is not compatible with this version of compiler
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli(KotlinCoreEnvironment.kt:667)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerExtensionsFromPlugins(KotlinCoreEnvironment.kt:169)
...
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.AbstractMethodError: Receiver class com.google.devtools.ksp.KotlinSymbolProcessingComponentRegistrar does not define or inherit an implementation of the resolved method abstract registerProjectComponents(Lcom/intellij/mock/MockProject;Lorg/jetbrains/kotlin/config/CompilerConfiguration;)V of interface org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar.
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli(KotlinCoreEnvironment.kt:659)
	... 28 more

I’m using IntelliJ iDEA 2022.01, Kotlin 1.6.20 and KSP 1.6.21-1.0.5

I checked in the source code of KSP and registerProjectComponents has the right signature. Any idea why this issue might arise or any way to disable the plugin when the code is compiled by IntelliJ ?

Thanks in advance

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

1reaction
neetopiacommented, Apr 28, 2022

If Gradle is working but IDE is not working, it is possibly your IDE’s gradle settings’ issue, can you check settings in Settings/Preferences -> Build,Execution,Deployment -> Build Tools -> Gradle?

0reactions
tklinchikcommented, Aug 6, 2022

Any more color on this issue? Hard to believe KSP is getting a ton of traction in a community without InteliJ support for it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle resolve dependecies and build/run fine but IntelliJ ...
I am using IntelliJ for one of my java projects. It has to build with gradle and from the command line, it works...
Read more >
Module compiles, but editor shows compilation issues
I have a bunch of Maven modules that compile file using Maven (both from command line and from IDEA) and compilation from IDEA...
Read more >
"The provided plugin org.jetbrains.kotlin.scripting.compiler ...
An IllegalStateException is thrown when building a simple gradle project using ... And since my Travis CI builds never failed with these, as...
Read more >
Gradle Kotlin DSL, error resolving KotlinCompile in build ...
And added the following code snippet to build.gradle.kts: ... KotlinCompile' which is a supertype of 'org.jetbrains.kotlin.gradle.tasks.KotlinCompile'.
Read more >
IntelliJ build.gradle.kts indicates errors but runs fine.
kts and the settings.gradle.kts file: However, gradlew build runs without errors/exceptions. How do I fix this?
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