What is Clean project in Android Studio really doing? What is Clean project in Android Studio really doing? android android

What is Clean project in Android Studio really doing?


Simple answer it Deletes the build directory

It removes whatever already-compiled files are in your project meaning it removes the .class files and recompiles the project again.

Source is here : https://www.jetbrains.com/help/idea/2016.3/cleaning-system-cache.html?search=clean

If you want to have some fun by cleaning yourself

Open your project path using cmd (go to project path and type cmd and hit enter like below)

enter image description here

Then use command gradlew clean and hit enter and see what happens when it cleans

enter image description here

For other tasks and meet your project's Mr.Gradle use command gradlew help

enter image description here


Clean action, basically invoking ./gradle clean task in your application directory, which is removing all generated files, removes build folders. So basically next time you will run/build all the artifacts will be builded from the scratch and will not be reused.

More information you can find on a official gradle site

Information about android plugin

DSL reference for Android plugin


Cleaning the project removes all build artifacts (ex: deleting the app/build folder)