I can't reproduce this. In an empty directory I get:
$ mkdir empty
$ cd empty
$ gradle --stacktrace --debug -g /tmp clean
<snip>
18:33:49.406 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
FAILURE: Build failed with an exception.
18:33:49.406 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
18:33:49.406 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
* What went wrong:
18:33:49.406 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
Task 'clean' not found in root project 'asd'.
18:33:49.406 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
18:33:49.406 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
* Try:
18:33:49.406 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
Run gradle tasks to get a list of available tasks. Run with --scan to get full insights.
18:33:49.406 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
18:33:49.406 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
* Exception is:
18:33:49.406 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
org.gradle.execution.TaskSelectionException: Task 'clean' not found in root project 'asd'.
<snip>
And on a very small gradle project with no external dependencies I get a "BUILD SUCCESSFUL in 0s"
$ git clone https://github.com/jabedhasan21/java-hello-world-with-gradle.git
$ gradle --stacktrace --debug -g /tmp clean
<snip>
18:37:34.955 [LIFECYCLE] [org.gradle.internal.buildevents.BuildResultLogger] BUILD SUCCESSFUL in 0s
<snip>
Please make sure you don't have any gradle daemon or java processes running
$ pgrep -a gradle
$ pgrep -a java
and kill them if needed
$ pkill -9 gradle
$ pkill -9 java
And that the cache, daemon, and native directories have been removed (I am forcefully creating them in /tmp through the '-g /tmp' parameter):
$ rm -rf /tmp/cache /tmp/daemon /tmp/native
Also please confirm that you are running the right gradle version:
$ gradle -version
<snip>
Groovy: 2.4.16
Ant: Apache Ant(TM) version 1.10.5 compiled on March 5 2019
JVM: 1.8.0_191 (Oracle Corporation 25.191-b12)
OS: Linux 4.19.0-13-generic amd64
<snip>
I can't reproduce this. In an empty directory I get: internal. buildevents. BuildExceptionR eporter] internal. buildevents. BuildExceptionR eporter] internal. buildevents. BuildExceptionR eporter] internal. buildevents. BuildExceptionR eporter] internal. buildevents. BuildExceptionR eporter] internal. buildevents. BuildExceptionR eporter] internal. buildevents. BuildExceptionR eporter] internal. buildevents. BuildExceptionR eporter] internal. buildevents. BuildExceptionR eporter] internal. buildevents. BuildExceptionR eporter] execution. TaskSelectionEx ception: Task 'clean' not found in root project 'asd'.
$ mkdir empty
$ cd empty
$ gradle --stacktrace --debug -g /tmp clean
<snip>
18:33:49.406 [ERROR] [org.gradle.
FAILURE: Build failed with an exception.
18:33:49.406 [ERROR] [org.gradle.
18:33:49.406 [ERROR] [org.gradle.
* What went wrong:
18:33:49.406 [ERROR] [org.gradle.
Task 'clean' not found in root project 'asd'.
18:33:49.406 [ERROR] [org.gradle.
18:33:49.406 [ERROR] [org.gradle.
* Try:
18:33:49.406 [ERROR] [org.gradle.
Run gradle tasks to get a list of available tasks. Run with --scan to get full insights.
18:33:49.406 [ERROR] [org.gradle.
18:33:49.406 [ERROR] [org.gradle.
* Exception is:
18:33:49.406 [ERROR] [org.gradle.
org.gradle.
<snip>
And on a very small gradle project with no external dependencies I get a "BUILD SUCCESSFUL in 0s" /github. com/jabedhasan2 1/java- hello-world- with-gradle. git internal. buildevents. BuildResultLogg er] BUILD SUCCESSFUL in 0s
$ git clone https:/
$ gradle --stacktrace --debug -g /tmp clean
<snip>
18:37:34.955 [LIFECYCLE] [org.gradle.
<snip>
Please make sure you don't have any gradle daemon or java processes running
$ pgrep -a gradle
$ pgrep -a java
and kill them if needed
$ pkill -9 gradle
$ pkill -9 java
And that the cache, daemon, and native directories have been removed (I am forcefully creating them in /tmp through the '-g /tmp' parameter):
$ rm -rf /tmp/cache /tmp/daemon /tmp/native
Also please confirm that you are running the right gradle version:
$ gradle -version
<snip>
Groovy: 2.4.16
Ant: Apache Ant(TM) version 1.10.5 compiled on March 5 2019
JVM: 1.8.0_191 (Oracle Corporation 25.191-b12)
OS: Linux 4.19.0-13-generic amd64
<snip>
$ apt policy gradle localhost: 9999/ubuntu- br bionic- proposed/ universe amd64 Packages dpkg/status localhost: 9999/ubuntu- br bionic/universe amd64 Packages
gradle:
Installed: 4.4.1-5~18.04.1
Candidate: 4.4.1-5~18.04.1
Version table:
*** 4.4.1-5~18.04.1 500
500 http://
100 /var/lib/
3.4.1-7ubuntu1 500
500 http://