-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KSP plugin works fine when compiling with gradle but fails when compiling with Intellij IDEA #969
Comments
If Gradle is working but IDE is not working, it is possibly your IDE's gradle settings' issue, can you check settings in |
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 |
Tried with |
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 |
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. |
well let's take one step back, what do you mean by |
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 |
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... |
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
The text was updated successfully, but these errors were encountered: