Search code examples
javaeclipsegradleliferay

Can't run Gradle Tasks on project


I'm trying to run a Gradle Task by double clicking it on Eclipse, but the task is greyed out and says "Cannot run tasks for included builds" if I right click it as you can see in the image below:

Gradle error

What's that supposed to mean? Suddenly I can't run tasks for no apparent reason when I was able a few hours ago.

My project is Liferay based. I'm under JDK 1.8 and Windows 10.

I tried restarting Eclipse, cleaning project, deleting .gradle folder, changing Gradle version to 4.10 and refreshing tasks but nothing changes.


Solution

  • I think I found a solution, in case someone's having the same problem:

    1. Copy project folder into another place
    2. Delete project on Eclipse (check "Delete project contents on disk")
    3. Delete .gradle folder inside the project folder
    4. File > Import > Existing Gradle Project
    5. Look for the project folder

    Now you should be able to run Gradle Tasks again.

    I hope this helps ;)