What does the Invalidate Caches/Restart do in Android Studio?

Android Studio makes a lot of files as caches and does not delete them. This can cause trouble when there is a need to make new files, so clearing caches will clear the old cache and make Android Studio faster.


Invalidate Cache clears project structure related information (only) cached by Android studio. Please note that this cache is different from "Build Cache" and "Gradle cache" briefly explained below.

Build Cache - stores certain outputs that the Android plugin for Gradle generates when building your project e.g. unpackaged AARs and pre-dexed remote dependencies. Build cache is enabled by default in recent plugins (2.3.0+).

Build Cache path: C:\Users\[User_Name]\.android\build-cache\gradleVersion

Here version value is driven by value defined in build.gradle file in your project. e.g. classpath "com.android.tools.build:gradle:$gradleVersion" Invalidate Cache has no impact on Build Cache. It can be cleared using "gradlew cleanBuildCache" command instead.

Gradle Cache - maintains Download Dependencies.

Gradle Cache path: C:\Users[user_name]\.gradle\caches\modules-2\files-2.1 [Windows] ~/.gradle/caches/modules-2/files-2.1 [Mac]

Also, as mentioned by @anurag, Clean Project has no relation to Build Cache.

More @ https://developer.android.com/studio/build/build-cache