Determine or configure plugin load order

I'm developing a plugin for Android Studio. I want my plugins main actions to show up in the AndroidTools group as a submenu.

Yet while I can select the "AndroidToolsGroup" in the "New Action" wizard, I constantly get this exception on startup of Android Studio when trying to run my plugin:

com.intellij.diagnostic.PluginException:XYZ (xyz): group with id "AndroidToolsGroup" isn't registered; action will be added to the "Other" group [Plugin: ...]


I then tried to put my action group in the usual "ToolsMenu" group, at the end. But now it gets moved up by the Android Tools Menu. So from what I see the Android plugin itself is initialized after my plugin. Is there any way to specify I depend on that plugin and as such will be initialised after that?


Thanks,
Mat
3 comments
Comment actions Permalink

Yes. If you add a <depends> tag to your plugin.xml (<depends>org.jetbrains.android</depends> in this case), then your plugin will be loaded after the plugin you depend on, and you can use the action groups provided by that plugin.

0
Comment actions Permalink

Thanks for that, worked perfectly.

What can I do about Intellij giving me an error "Cannot resolve plugin org.jetbrains.android"?

0
Comment actions Permalink

You can add the jars of the Android plugin to the classpath of your plugin SDK. Or just ignore the error; it doesn't have any actual consequences.

0

Please sign in to leave a comment.