1

I am learning Android development, and I am confused with clean and rebuild project. My questions are :

  1. Under which circumstances we need to clean and rebuild project? And why ?
  2. What is the difference between clean and rebuild project?
VariableTao
  • 171
  • 8
  • Useful to get back to a sane state when the build system gets somehow confused. It is worth a try when you notice strange inexplicable effects – Henry Feb 08 '21 at 04:29

1 Answers1

0

Gradle will maintain build cache, you can see that for your project under app/build folder, it contains auto generated classes, build caches which gradle will use to reduce work every time when your are building a project, doing a clean will clear the caches for project and tells Gradle to do a fresh build causing significant additional build time for the subsequent task execution.

Rebuild does clean first and then build the project.

Rajan Kali
  • 12,627
  • 3
  • 25
  • 37