KSP plugin works fine when compiling with gradle but fails when compiling with Intellij IDEA
See original GitHub issueThe 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:
- Created a year ago
- Reactions:4
- Comments:6
Top 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 >
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
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
?Any more color on this issue? Hard to believe KSP is getting a ton of traction in a community without InteliJ support for it