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?
The Gradle tool window is enabled automatically when you create or open your Gradle project. Click Gradle on the right sidebar to open the tool window.
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.
We can get to the settings from the Gradle Tool Window, or from the usual Settings/Preferences dialog (⌘, (macOS), or Ctrl+Alt+S (Windows/Linux)) and navigating to Build, Execution, Deployment | Build Tools | Gradle. Generally these settings are fine for most projects, and don't need changing.
As of 2018.3.6:
build.gradle
/build.gradle.kts
fileIn regards to the OP's question at the time when IDEA 13 was released, the Gradle Plugin was rewritten and improved in IntelliJ IDEA 13. As a result, Gradle based IDEA projects created in previous versions of IntelliJ IDEA needed to be reimported when first opened in IntelliJ IDEA 13.
Post IntelliJ IDEA 13, sometimes the Gradle Tool window will disappear if the IntelliJ IDEA Project gets out of sync or its configuration gets corrupted.
build.gradle
/build.gradle.kts
file in the Project tool windowNOTE 1: If the context menu option is not available, then that typically means the Gradle Plugin got disabled or uninstalled. Go to Settings/Preferences > Plugins and enable or install the JetBrains Gradle plugin.
NOTE 2: If the gradle build can not be completed successfully, IntelliJ IDEA may not be able to sync to it properly. In such cases, you will likely need to get the gradle build working first.
While the above "Quick Fix" should work most of the time, if it does not work, you may need to:
gradle.xml
file in the project's .idea
directory. Delete or rename it. (If you have gotten to this point, it is most likely this file has been corrupted and we want IntelliJ IDEA to recreate it.) Then reopen the project in IntelliJ IDEA and run the quick fix.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 discussed below.
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 some 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:
gradle.build
file 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With