5

I create a plugin for IntelliJ IDEA and I want it to run on Android Studio and other products based on IDEA.

I use gradle-intellij-plugin and have such settings:

build.gradle

buildscript { ext.kotlin_version = '1.2.10' repositories { mavenCentral() jcenter() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } plugins { id "org.jetbrains.intellij" version "0.2.17" id "org.jetbrains.kotlin.jvm" version "1.2.10" } group pluginGroup version pluginVersion apply plugin: 'org.jetbrains.intellij' apply plugin: 'java' apply plugin: 'kotlin' intellij { version 'IC-2017.3' plugins 'git4idea' pluginName "plugin name" } repositories { mavenCentral() } dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" //... testCompile group: 'junit', name: 'junit', version: '4.12' } compileKotlin { kotlinOptions.jvmTarget = "1.8" } compileTestKotlin { kotlinOptions.jvmTarget = "1.8" } 

plugins.xml

<idea-plugin> ... <idea-version since-build="143.379"/> <depends>com.intellij.modules.lang</depends> <depends>com.intellij.modules.vcs</depends> <depends>Git4Idea</depends> ... </idea-plugin> 

On IntelliJ IDEA is installed without errors. When install on Android Studio 3.0.1 there is an error

Plugin 'plugin name' is incompatible with this installation

How to fix the error?

2 Answers 2

2

I met the same problem too and I solved it from plugin.xml , you can also find the solution easily in plugin.xml .

In plugin.xml , you can see this :

<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description --> <idea-version since-build="173.0"/> <!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html on how to target different products --> <!-- uncomment to enable plugin in all products <depends>com.intellij.modules.lang</depends> --> 

we can get two links :

  1. http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html
  2. http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html

I solve the problem by the 1st link , I think the 2nd link is also worth to collect .

Go into the 1st link , and scroll down you will see: enter image description here

So just change

idea-version since-build="173.0"

to

idea-version since-build="141"

Now you can retry to prepare your plugin .

Sign up to request clarification or add additional context in comments.

Comments

0

Сhanged the settings and it works for me

build.gradle

buildscript { ext.kotlin_version = '1.2.10' repositories { mavenCentral() jcenter() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } plugins { id "org.jetbrains.intellij" version "0.2.17" } group pluginGroup version pluginVersion apply plugin: 'org.jetbrains.intellij' apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'idea' sourceCompatibility = 1.8 targetCompatibility = 1.8 intellij { version '2017.3' plugins 'git4idea' pluginName "plugin name" updateSinceUntilBuild false type 'IC' } repositories { mavenCentral() } dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile 'com.google.code.gson:gson:2.8.2' compile("com.taskadapter:redmine-java-api:3.1.0") { exclude group: "org.slf4j" } // testCompile group: 'junit', name: 'junit', version: '4.12' } compileKotlin { kotlinOptions.jvmTarget = "1.8" } compileTestKotlin { kotlinOptions.jvmTarget = "1.8" } 

plugin.xml

<idea-version since-build="141.177"/> <depends>com.intellij.modules.lang</depends> <depends>Git4Idea</depends> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.