Obfuscation
Answered
I have run proguard to obfuscate the plugin I am developing. I ran it on the zip file in the build/distributions folder.
When I try to install the obfuscated plugin I get errors like:
Caused by: java.lang.ClassNotFoundException: *** PluginClassLoader[***, 1.0-SNAPSHOT] com.intellij.ide.plugins.cl.PluginClassLoader@707a0b90
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:75)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at com.intellij.openapi.components.impl.ComponentManagerImpl.registerComponents(ComponentManagerImpl.java:386)
Just to note, when I install the plugin using the zip file that Intellij produces (no obfuscation), it installs fine.
It is mentioned in https://plugins.jetbrains.com/docs/marketplace/obfuscate-the-plugin.html that proguard has been used to obfuscate plugins. Could someone give me a little guidance as to how the obfuscation is configured?
Thanks.
Please sign in to leave a comment.
Please make sure you do not obfuscate classes that are defined in your plugin.xml
Thanks Yann. Having done that I now get an error like:
Think I need to change something in my proguard config. right now it looks like this:
The obfuscation step runs fine. I just get these run time errors when I try to run the obfuscated plugin.
Make sure not to obfuscate any constructors and any types used there for anything registered in plugin.xml