简体   繁体   中英

No Gradle Tool Window in IntelliJ IDEA 13?

I can't find the Gradle Tool Window in IntelliJ IDEA 13 anymore. Is it removed?

Furthermore I can't run any Gradle Tasks within my Gradle build file (via context-menu -> Run ). The error message: Module XY is not backed by gradle occurs. All these runs perfectly in IntelliJ IDEA 12.

What is going wrong here?

There were significant improvements (and changes) to the Gradle Plug-in in IDEA 13. As a result, you need to reimport the gradle project.

First, see if the tool window can be opened via View > Tool Windows > Gradle . If so, the gradle project is configured and ready to use. If not, you will need to re-import the project as follows:

While your project settings should be maintained, it would be prudent to backup the .idea directory prior to doing the re-import. Go to File > Import Project (or File > New > Project from Existing Sources in newer IntelliJ versions), select and import your *.gradle file. You can choose "This Window" when prompted as to what window to open the project in. You will then have the Gradle window (renamed from JetGradle ) and gradle functionality. All your previous project settings should remain intact. If not, close the project and do a diff of the backed-up and current .idea directories.

For newer versions of IDEA, the above may not work if done with the project opened. Instead, you will need to close the project, and do the import from the Welcome Screen or another project. This also holds true if the project was never a gradle project and you want to add gradle functionality/backing.

IntelliJ have certainly had trouble solving this particular problem, but as of 2018.3.6 the solution has certainly gotten better:

  1. find the gradle.build file
  2. right-click on it and select Import Gradle Project

no idea (badoom tshhhh) why they've decided to do it this way, but it works, the Gradle tool window becomes available, and it has become a gradle project.

You can add a gradle.xml file in your .idea directory

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="GradleSettings">
    <option name="linkedExternalProjectsSettings">
      <GradleProjectSettings>
        <option name="distributionType" value="LOCAL" />
        <option name="externalProjectPath" value="$PROJECT_DIR$" />
        <option name="gradleHome" value="$USER_HOME$/.gradle" />
        <option name="gradleJvm" value="1.8.0_40" />
      </GradleProjectSettings>
    </option>
  </component>
</project>

This should enable the gradle panel to show up.

Make sure to replace the correct paths above

What helped me was File > Invalidate Chaches and Restart
After restarting the gradle menu was available

In IntelliJ IDEA 2016.2.2 version, from main menu, try;

View->Tool windows-> Gradle

Update: For those who are downvoting, this answer gave the menu solution before the accepted answer.

This helped me: (In IntelliJ 2019.2.4)

  1. File -> Invalidate Caches/Eestart
  2. Right Click on your build.gradle in your Project in Project View -> At the bottom click on : Import Gradle Project
  3. View -> Tool Windows -> Gradle

What is going wrong here?

The possible reason is that GRADLE_HOME environment variable points to the wrong location.

In IntelliJ 2019.3 I faced the same issue, in addition it was not recognizing Gradle projects when I imported them. I fixed it by doing this:

  1. Disable Gradle plugin
  2. Restart IntelliJ
  3. Enable Gradle plugin again
  4. Restart IntelliJ

Done!

在此处输入图片说明

它对我有用。解决方法是关闭克隆的项目,然后将 build.gradle/build.gradle.kts 文件作为项目打开。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM