yurisnm
yurisnm

Reputation: 1640

Can't find Android Studio when creating plugin on Intellij using alternativeIdePath

What I need:

Instead of opening a new instance of IntelliJ, I need it to open an Android Studio instance, since it will be an Android Studio plugin.

What I've already achieved:

  1. Create the simplest plugin to IntelliJ.
  2. Execute this plugin and a new instance of IntelliJ opens.
  3. Execute the plugin and it works just fine.

I have already changed the alternativeIdePath as many tutorials tell me to.

Guide I've been following.

I have tried in many ways to set the alternativeIdePath.

intellij {
//    version '2018.2.5'
    alternativeIdePath "/opt/android-studio/bin/studio.sh"
}

also

intellij {
//    version '2018.2.5'
    alternativeIdePath "/opt/android-studio/bin/ ./studio.sh"
}

and some other naive ways...

I have also tried to runIde from my gradle in the right side.

runIde

Before I had my Android Studio and Android/Sdk on my user location and it didn't work as well. So I moved everything to my /opt/android-sdk and /opt/android-studio/ to see if it was the problem and it isn't.

Here is my log, since it doesn't find the Android Studio path:

09:04:43: Executing task ':runIde'...


> Configure project :
Cannot find alternate SDK path: /Applications/Android App /opt/android-studio/bin/studio.sh. Default IDEA will be used : /home/yurisnm/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/2c16b45a5e389f84167a176491768cfd5a70e8a9/ideaIC-LATEST-EAP-SNAPSHOT
Cannot find alternate SDK path: /Applications/Android App /opt/android-studio/bin/studio.sh. Default IDEA will be used : /home/yurisnm/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/2c16b45a5e389f84167a176491768cfd5a70e8a9/ideaIC-LATEST-EAP-SNAPSHOT

> Task :compileKotlin UP-TO-DATE
> Task :compileJava UP-TO-DATE
> Task :patchPluginXml UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :instrumentCode UP-TO-DATE
> Task :postInstrumentCode
> Task :inspectClassesForKotlinIC UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :prepareSandbox UP-TO-DATE

> Task :runIde
Cannot find alternate SDK path: /Applications/Android App /opt/android-studio/bin/studio.sh. Default IDEA will be used : /home/yurisnm/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/2c16b45a5e389f84167a176491768cfd5a70e8a9/ideaIC-LATEST-EAP-SNAPSHOT
Cannot find alternate SDK path: /Applications/Android App /opt/android-studio/bin/studio.sh. Default IDEA will be used : /home/yurisnm/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/2c16b45a5e389f84167a176491768cfd5a70e8a9/ideaIC-LATEST-EAP-SNAPSHOT
Cannot find alternate SDK path: /Applications/Android App /opt/android-studio/bin/studio.sh. Default IDEA will be used : /home/yurisnm/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/2c16b45a5e389f84167a176491768cfd5a70e8a9/ideaIC-LATEST-EAP-SNAPSHOT
Cannot find alternate SDK path: /Applications/Android App /opt/android-studio/bin/studio.sh. Default IDEA will be used : /home/yurisnm/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/2c16b45a5e389f84167a176491768cfd5a70e8a9/ideaIC-LATEST-EAP-SNAPSHOT
Cannot find alternate SDK path: /Applications/Android App /opt/android-studio/bin/studio.sh. Default IDEA will be used : /home/yurisnm/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/2c16b45a5e389f84167a176491768cfd5a70e8a9/ideaIC-LATEST-EAP-SNAPSHOT
Cannot find alternate SDK path: /Applications/Android App /opt/android-studio/bin/studio.sh. Default IDEA will be used : /home/yurisnm/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/2c16b45a5e389f84167a176491768cfd5a70e8a9/ideaIC-LATEST-EAP-SNAPSHOT
Cannot find alternate SDK path: /Applications/Android App /opt/android-studio/bin/studio.sh. Default IDEA will be used : /home/yurisnm/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/2c16b45a5e389f84167a176491768cfd5a70e8a9/ideaIC-LATEST-EAP-SNAPSHOT
Cannot find alternate SDK path: /Applications/Android App /opt/android-studio/bin/studio.sh. Default IDEA will be used : /home/yurisnm/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/2c16b45a5e389f84167a176491768cfd5a70e8a9/ideaIC-LATEST-EAP-SNAPSHOT
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=250m; support was removed in 8.0

BUILD SUCCESSFUL in 14s
10 actionable tasks: 2 executed, 8 up-to-date
09:04:57: Task execution finished ':runIde'.

And now I got my back against the wall.

Upvotes: 3

Views: 1155

Answers (2)

zsts
zsts

Reputation: 21

Same issue with PyCharm plugin development. Things gets worse when using JetBrains Toolbox (there is scary path to PyCharm IDE dir, check it out):

Setting build.gradle -> intellij -> alternativeIdePath '/home/bla/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/191.7479.30' helps me and allows to test/debug my plugin via gradle runIde command.

Upvotes: 0

Thiago Fonseca
Thiago Fonseca

Reputation: 36

Try to remove the alternativeIdePath "studio.sh" of the path, like bellow:

intellij {
//    version '2018.2.5'
    alternativeIdePath "/opt/android-studio/"
}

Upvotes: 2

Related Questions