Git4idea in installed plugin doesn't work



I try to use git4idea in my plugin (git4idea works when developing my plugin, there are no problems here), but after building the my plugin and installing it in PhpStorm, I get the error "git4idea.repo.gitrepositorymanager cannot be cast to class". I understand the reason, but I can't understand what is wrong with connecting the git4idea plugin.

What I did:

  1. 1. added to the plugin.xml <depends>Git4Idea</depends>
  2. 2. added in the SDKs module settings git4idea.jar in the Classpath.
  3. 3. also in the module settings, added git4idea as library on Modules -> Dependencies (tried both scopes Compile and Provided)

I reviewed a lot of topics, but did not find an answer.

1 comment
Comment actions Permalink

There is a high probability that the attached Git4Idea jar may be not compatible with the specified SDK.

The recommended way of handling dependencies is to use Gradle instead of DevKit. For more details, please refer to the Building Plugins with Gradle documentation article. You may also consider using IntelliJ Platform Plugin Template with pre-configured plugin scaffold.


Please sign in to leave a comment.