Open aduchate opened 2 years ago
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
?
That's the point, I'd like to be able to compile with IntelliJ and not using gradle. If I use gradle as the build system, it works fine. When I was using kapt, the behaviour was that kapt wasn't called at all when the build was made using IntelliJ native build system. I would love to be able to have the same behaviour using kpt.
See exactly the same issue, also tried 1.7.0-Beta (in Gradle and IntelliJ plugin) and still get the same
This might be caused by incompatible compilers used in Gradle and cmdline mode. Can you try to replace the artifact to be using symbol-processing-cmdline
?
Tried with symbol-processing-cmdline
artifact but IntelliJ is still not happy.
Any more color on this issue? Hard to believe KSP is getting a ton of traction in a community without InteliJ support for it
any update on this issue i am also getting this exception
com.google.devtools.ksp.KotlinSymbolProcessingComponentRegistrar is not compatible with this version of compiler
Doesn't seem like there is a solution for this that I'm aware of. I'm forced to use Gradle executor in IntelliJ rather than IDEA as a workaround.
please make sure the compiler version used by KSP is matching the compiler version used by your build tool (IntelliJ Gradle executor in your case).
That's what I have currently unless IntelliJ for some reason uses different internal compiler version which seems unlikely. I've gone through many versions of IntelliJ, gradle and kotlin and still see the same issue. Any way I can confirm your suspicion of compiler version difference? The error almost seems to imply classpath differences when running in IntelliJ but I can't figure out what's actually expected to be there.
well let's take one step back, what do you mean by use Gradle executor in IntelliJ rather than IDEA
?
In IntelliJ Preferences under "Build, Execution, Deployment" -> "Build Tools" -> "Gradle" there are few options under "Run tests using". If you chose "IntelliJ IDEA" then the issue will manifest, if you choose "Gradle" then the issue goes away when running tests.
Well that's what I originally meant then. You should be choosing Gradle
for running tasks if you are using Gradle as the build tools for the project. It is also mentioned in the same setting window that if you are running a Gradle project with IDEA runner, Gradle plugins might not work and you might get incorrect results.
Perhaps this is more of an issue to be filed against IntelliJ, similar to https://youtrack.jetbrains.com/issue/KT-15040/Support-Kapt-in-IDEA-build-system-JPS.
Also reproduced in ksp playground... https://github.com/google/ksp/tree/main/examples/playground
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
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