gradle Verified current stable Not installed? Build Tools

Gradle / Clean With Detailed Logging Common

Clean With Detailed Logging Common

Cleans the project with detailed logging enabled.

$
Terminal
gradle clean -i

When To Use

When diagnosing issues during the clean phase that may not be apparent with default logging.

Pro Tip

Consider `--debug` for even more granular output when troubleshooting odd behaviors in the clean.”

Anatomy of Output

Understanding the result

> Task :clean Task Execution

Indicates that the clean task is being executed.

Cleaning build directory... Process Output

Shows the specific operation occurring during the clean.

BUILD SUCCESSFUL Build Status

The clean task completed without issues.

Power User Variants

Optimized versions

gradle clean -i

Runs the clean command with info level logging.

gradle clean --scan

Generates a build scan for detailed analysis.

Troubleshooting

Common pitfalls

Could not clean the project due to locked files.

Solution: Close any editors that may have files open in the build directory.

Could not find task ':clean'.

Solution: Ensure that the task has been defined in the build.gradle file.

Execution failed for task ':clean'.

Solution: Check for existing build artifacts that may have permission issues.

Command Breakdown

What each part is doing

gradle
Base Command
The executable that performs this operation. Here it runs Gradle before the shell applies any redirect operators.
-i
i| info
The value supplied for i| info.
-i
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative build tools tools for the same job.