Unable to make the module: related gradle configuration was not found. Please, re-import the Gradle project and try again
Asked Answered
A

12

161

I use IntelliJ IDEA Ultimate 14 and Gradle 1.2. I manage the project from the console, but I need to debug some of the code from the IDE.

When I try to make the project, this error window appears. When I try to debug the project,

Error: Unable to make the module: idappcli, related Gradle configuration was not found. 
Please, re-import the Gradle project and try again.

is written in the message window. How can I add the regular output paths to the project?

Ambler answered 28/1, 2015 at 13:53 Comment(0)
B
259

Try by opening the gradle task view and then click the refresh button. For me it solved the problem.

Balancer answered 29/1, 2015 at 11:41 Comment(8)
When you import the gradle project there is an "auto-import" checkbox.Revere
You can show the view by clicking View -> Tool Windows -> Gradle in the main menu next to File and Edit.Thelen
Has no effect for me on 15.0.2.Rimini
I still use this trick on my IntelliJ 2016.2.1 and it works without problems. Be aware that you need to wait that all dependencies are updated before being able to "use" again the projectBalancer
After upgrading to IntelliJ 2016.3 I encountered this issue.Ithnan
@Trejkaz perhaps because it takes a helluva lot of time.Helfant
@JohnRed a working project which takes a little bit longer to open up, versus a project which is quick to open but doesn't actually work; I'll take the one which is slower to open up.Bassoon
I am getting this problem on a Gradle project Import. This if or recent "Community Build: IntelliJ IDEA 2017.1.2 Build #IC-171.4249.39, built on April 25, 2017" -- Three Kotlin simple "HelloWorld" type projects give the same errors. Reloading re-importing, cleaning-out the cache hadn't fixed things. Command line gradle build works, they run. What is it? Here I was thinking JetBrains were right behind Kotlin?????Carious
P
80

I also had a similar problem, Go to : View -> Tool Windows -> Gradle.
Then press in Refresh Icon

enter image description here

Putnam answered 12/4, 2016 at 14:10 Comment(0)
Y
22

This fixed the issue "Please, re-import the Gradle project and try again." for me (IntelliJ Ultimate 17.3.3):

(1) Detached Gradle project:

detach

(2) Closed the project and (3) re-opened it via File > Open recent. IntelliJ will promt to import the now unlinked Gradle project. (4) Imported it and selected "Use auto-import" in the dialog.

enter image description here

Yseulte answered 1/2, 2018 at 20:27 Comment(0)
H
17

I had the same problem with my Intellij IDEA version 2016.2 (Mac)

The solution was: In Intellij, Click on "View" then "Tool Windows" then "Gradle" then click on enter image description here

Horribly answered 4/8, 2016 at 22:30 Comment(0)
M
9

I had to make sure the Use auto-import and the Use default gradle wrapper (recommended) were both checked.

File > Other Settings > Default Settings > Build, Execution, Deployment > Build Tools > Gradle

Intellij Gradle Preferences

Monies answered 16/8, 2016 at 2:47 Comment(2)
what do you do if Use default gradle wrapper is greyed out?Agnola
Make sure you have the gradle wrapper installed in your project. docs.gradle.org/current/userguide/gradle_wrapper.htmlMonies
S
3

I faced the similar issue when i update my IntelliJ Idea.

To fix it i ran the below command in terminal and it fixed my problem.

gradle cleanIdea idea
Sato answered 8/3, 2017 at 0:30 Comment(0)
N
3

For most people the refresh of Gradle that has already been suggested might solve the issue.

For the others I figured out, that deleting the .idea direcotory and reimporting the project might help.

It can be that your resources directory is not added to classpath when creating a project via Spring Initializr. So your application is never loading the application.properties file that you have configured.

To make a quick test if this is the case, add the following to your application.properties file:

server.port=8081

Now when running your application you should see in the spring boot console output something like this:

INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): **8081** (http) with context path ''

If your port is still default 8080 and not changed to 8081, your application.properties files is obviously not loading.

You can also check if your application runs with gradle bootRun from command line. Which most likely will be work.

Solution:

  1. Close IntelliJ, then inside your project folder delete the ".idea" folder
  2. Reimport your project to IntelliJ like following: "Import Project" -> "select ONLY your build.gradle file to import". (IntelliJ will automatically grab the rest)
  3. build and run your application again

See official answer by IntelliJ Support: IDEA-221673

Noncontributory answered 31/1, 2020 at 13:44 Comment(0)
N
2

This works for me:

  1. Close the IntelliJ Idea
  2. Delete 'gradle' and '.gradle' folders from the project root
  3. Start IntelliJ Idea and import the project as gradle

screensshots before and after

Nabokov answered 8/9, 2019 at 3:46 Comment(0)
I
1

In my case the root cause was a missing proxy configuration. Once I configured it properly I was able to Refresh gradle projects and it finally downloaded missing files and set up the project correctly.

File > Settings > Appearance & Behaviour > System Settings > HTTP proxy

then

View > Tool Windows > Gradle 

and Synchronize button

Interinsurance answered 27/6, 2017 at 19:13 Comment(0)
D
0

I went into the IntelliJ Gradle preferences:

Menu: Preferences > Build, Execution, Deployment > Build Tools > Gradle

And under Project Level Settings, switched the radio button to "Use default gradle wrapper (recommended)"

Hit the make button, and was in business!

Divvy answered 24/10, 2015 at 7:29 Comment(0)
M
-1

@user1339 I also had the same problem. Please, read this question Building war with Gradle, Debugging with IntelliJ IDEA. It'll be very helpful for you. And recommendation for the 'Make' task. As message said, I should try to re-import the Gradle project and try again. In my case this advice became very helpful.

Mayfield answered 29/1, 2015 at 9:11 Comment(0)
Z
-1

I recommend to try to 'Build > Rebuild Project'.screen capture of menu

Zymotic answered 30/1, 2019 at 5:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.