Could not set unknown property 'ideDirectory' for task ':runIde' of type org.jetbrains.intellij.tasks.RunIdeTask

Answered

I am trying out an Android Studio Plugin with the new IntelliJ Plugin SDK and ran into the following error when building the code using IntelliJ Ultimate Edition.

Build file '/Users/hle3/dev/plugin/build.gradle' line: 35

A problem occurred evaluating root project 'plugin'.
> Could not set unknown property 'ideDirectory' for task ':runIde' of type org.jetbrains.intellij.tasks.RunIdeTask.

* Try:
Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.

From the error, it looks like that ideDirectory is an unknown property, but according to the doc https://plugins.jetbrains.com/docs/intellij/android-studio.html#configuring-the-plugin-pluginxml-file, it is how you configure to run your plugin in android studio.

Here's my build.gradle file

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.5.10'
    id 'org.jetbrains.intellij' version '1.1.4'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.5.21'
}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
    //version = '2021.2'
    // Define IntelliJ Platform against which to build the plugin project.
    version = '191.8026.42'  // Same IntelliJ IDEA version (2019.1.4) as target 3.5 Android Studio
    type = 'IC'              // Use IntelliJ IDEA CE because it's the basis of the IntelliJ Platform
    // Require the Android plugin, Gradle will match the plugin version to intellij.version
    plugins = ['android']
}

runIde {
    ideDirectory = '/Applications/Android Studio.app/Contents'
}

patchPluginXml {
    changeNotes = """
      Add change notes here.<br>
      <em>most HTML tags may be used</em>"""
}
 
 

0
6 comments

thanks Yann Cebron for the reply. yes, the document was fixed and I tried the new `ideDir` attribute and kept running into issue.  I'll post it again here. 

runIde {
    ideDir = '/Applications/Android Studio.app/Contents'
}

I am getting a different error this time, complaining that ideDir cannot take a string. Could you provide an example of what ideDir path should look like to point to Android Studio?

I've looked at the README and the definitions of path are different in different places of the documentation.

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/hle3/dev/plugin/build.gradle' line: 36

* What went wrong:
A problem occurred evaluating root project 'plugin'.
> Cannot set the value of task ':runIde' property 'ideDir' of type org.gradle.api.file.Directory using an instance of type java.lang.String.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 294m

Please help provide a working example for ideDir.  It doesn't take a string and from the doc I have trouble getting it to work. 

Thanks

0

Use e.g. `org.gradle.api.Project#file(java.lang.Object)`

0

thanks for the reply -- i'll give Directory a try. 

The official Android Studio plugin documentation is still wrong.  

https://plugins.jetbrains.com/docs/intellij/android-studio.html.  This code will not run because ideDir doesn't take a string.  Could you please ask the team to update this to something that developers can work with? 

Thanks

runIde {
    // Absolute path to installed target 3.5 Android Studio to use as IDE Development Instance
    // The "Contents" directory is macOS specific.
    ideDir = '/Applications/Android Studio.app/Contents'
}
0

Yann Cebron

Did the team get a chance to update https://plugins.jetbrains.com/docs/intellij/android-studio.html.  documentation. 

The `ideDir` is still there and it is not usable because ideDir does not take a string.  

Please update

0

Use e.g. org.gradle.api.Project#file(java.lang.Object) like `file('path')`

0

Please sign in to leave a comment.