Plugin ClassNotFound in v2021.2
Hi there,
When running a plugin that worked fine in 2021.1 in 2021.2 from the idea via gradle->runIde (but also when being regularly installed to the IDE), I now get some kind of splashscreen error:
I'd think that the class is there and correctly compiled, because the rest of the plugin works fine (once I disabled the problematic component
```
<project-components>
<component>
<implementation-class>io.github.holgerbrandl.send2terminal.actions.CodeEvalActionRegistry
</implementation-class>
</component>
</project-components>
```
in the plugin.xml
Sources are located in https://github.com/holgerbrandl/send2terminal/tree/master and the problematic class (which simply extends a custom menu) is https://github.com/holgerbrandl/send2terminal/blob/master/src/main/java/io/github/holgerbrandl/send2terminal/actions/CodeEvalActionRegistry.java
Any advice about how to fix compatibility with the latest version of Intellij would be appreciated.
Thanks & best regards,
Holger
Please sign in to leave a comment.
Project components are deprecated for a long time now. Please upgrade your code, as described in the IntelliJ SDK documentation: https://plugins.jetbrains.com/docs/intellij/plugin-components.html
I had noticed the deprecation. However, the page you were referring to states "When writing new plugins, creating Components should be avoided.". But it seems that 2021.2 simply breaks (some) legacy plugins (such as mine).
I would not mind porting it, but I'm unsure into which direction to go. The offending class in https://github.com/holgerbrandl/send2terminal/blob/master/src/main/java/io/github/holgerbrandl/send2terminal/actions/CodeEvalActionRegistry.java is extending a custom menu with some dynamic entries. To part of the plugin structure would such logic need to be moved? Like service, some postStartupActivity, or maybe some other extension point? Could you give me some pointer in which direction to go?
Thanks & best regards,
Holger
please remove whitespace around FQN inside the <...component> tags
https://youtrack.jetbrains.com/issue/IDEA-272393
Thanks for the workaround Yann Cebron . Works for me, but it's a bit shaky because reformatting of the plugin.xml will bring back the whitespace.
Yes thanks for the workaround Yann Cebron !!! It would have taken me a while to find that one.
Jakub Chrzanowski I would love to move away from Project components however I have dependencies on Android Studio and the Android Plugin which tie me to this deprecated pattern.
(Unless i'm wrong and Google has now moved away from this), upon last inspection of their source they still seem to be referencing it. If possible I would appreciate if you could give Google a nudge towards the more modern APIs.
Many thanks all.