Should I add .idea/caches/build_file_checksums.ser to .gitignore?

You should add it to .gitignore. Don’t include it in your git add.

In the left-side Project window,

(a) change the Android view to the Android project view, with the pull-down menu.
(b) You can see build_file_checksums.ser in folder .idea/caches.
(c) Open .gitignore of the project root directory. (Don’t confuse it with .gitignore of the app module.)

In the right-side .gitignore content,

(d) add /.idea/caches/build_file_checksums.ser.

enter image description here


JetBrain’s guide told that you should share

  • All the files under .idea directory in the project root except the workspace.xml and tasks.xml files which store user specific settings

and it also said

You may consider not to share the following:

  • .iml files for the Gradle or Maven based projects, since these files will be generated on import
  • gradle.xml file, see this discussion
  • user dictionaries folder (to avoid conflicts if other developer has the same name)
  • XML files under .idea/libraries in case they are generated from Gradle or Maven project

Therefore, the default .gitignore for new projects in Android Studio is:

*.iml
.gradle
/local.properties
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/captures
.externalNativeBuild

But, the build_file_checksums.ser file is a Java serialized object, which contains hash and timestamp of:

  • “settings.gradle”
  • “build.gradle”
  • “local.properties”
  • “/Users/(User Name)/.gradle/gradle.properties”
  • “gradle.properties”
  • “app/build.gradle”

So, it seems like the issue was priority P2 and severity S2, and has been already accepted and fixed. I look forward to future release, in which the default .gitignore includes

/.idea/caches/build_file_checksums.ser

Leave a Comment