I'm using IntelliJ IDEA Pro 13.1.2. Never used any versions below 13.
When trying to run build.gradle
from IDE I get the message:
Module is not backed by gradle
I can run this script from the command line just fine.
The "root" directory has both .gradle
and gradle
sub-directories and, in general its structure is very similar to another module from the same project where I can run its build from IDE without problems.
Any suggestions on further troubleshooting?
Hope it works for you.
This problem happened for me because I chose a different name for my project than my artifactID. In order to prevent this problem to happen, make sure your project name is the same as your artifactID.
The answer that worked for me is to restart IntelliJ - at startup build.gradle is identified and the project is set up.
The only thing that worked for me was to use the menu
File > Close Project
and reopen it. IDEA popped up a dialog saying "Import project from Gradle files" or something to that effect.Dead ends: Below is a list of dead ends, so don't waste your time with them. I kept seeing "module is not backed by gradle" despite following all these dead ends. At the time of this reading, none of these answers worked:
File > Open
gradle.build opens the file for editing and doesn't solve the issuebuild/
folder created./gradlew
from the commandline only creates files for gradle and doesn't fix IntelliJYou may have originally created the project via
File->New->Project From Version Control
. This doesn't seem to always set the project up as a Gradle project, even if there is a build.gradle in the root directory. To solve this:-The project will be recognised as Gradle and be set up as such.
Like others have said, none of the other answers worked for me. The only thing that worked was:
Close the project, then import it as a Gradle project.
I'm using android studio, intellij. Try this: