I updated my Android Studio from 3.0.1 to 3.1, and noticed an unfamiliar file in my existing project:
.idea/caches/build_file_checksums.ser
It doesn't depend on whether you update the Android Gradle plugin to the latest 3.1.0; once I opened an existing project in Android Studio 3.1, it automatically created the file build_file_checksums.ser
, even if I kept the project to use the previous 3.0.1 plugin as follows.
dependencies { classpath 'com.android.tools.build:gradle:3.0.1' }
I also created a new project in Android Studio 3.1, and found that the file build_file_checksums.ser
was created from the beginning.
At the time of writing, there seems to be no official documents on this. I would appreciate it if anyone could find it.
I inspected the content with jdeserialize-1.2, as Samuel pointed out that it seems to include some system paths.
$ java -jar ~/Downloads/jdeserialize-1.2.jar .idea/caches/build_file_checksums.ser read: com.android.tools.idea.gradle.project.ProjectBuildFileChecksums _h0x7e0002 = r_0x7e0000; //// BEGIN stream content output com.android.tools.idea.gradle.project.ProjectBuildFileChecksums _h0x7e0002 = r_0x7e0000; //// END stream content output //// BEGIN class declarations (excluding array classes) class java.util.HashMap implements java.io.Serializable { float loadFactor; int threshold; } class com.android.tools.idea.gradle.project.ProjectBuildFileChecksums implements java.io.Serializable { long myLastGradleSyncTimestamp; java.util.Map myFileChecksums; } //// END class declarations //// BEGIN instance dump [instance 0x7e0004: 0x7e0003/java.util.HashMap object annotations: java.util.HashMap [blockdata 0x00: 8 bytes] [String 0x7e0005: "settings.gradle"] [array 0x7e0007 classdesc [cd 0x7e0006: name [B uid -5984413125824719648]: [arraycoll sz 16 -89, -2, 26, -61, -111, 105, -75, -27, 40, 90, 94, 83, 102, 47, 37, 27] [String 0x7e0008: "build.gradle"] [array 0x7e0009 classdesc [cd 0x7e0006: name [B uid -5984413125824719648]: [arraycoll sz 16 70, 101, -14, 32, 100, -60, -85, -103, 73, -86, 15, 54, -45, 125, 50, 39] [String 0x7e000a: "local.properties"] [array 0x7e000b classdesc [cd 0x7e0006: name [B uid -5984413125824719648]: [arraycoll sz 16 -107, 64, 60, -33, -18, 18, 56, -84, 15, 0, -86, -73, -27, 127, -94, 27] [String 0x7e000c: "/Users/qtmfld/.gradle/gradle.properties"] [array 0x7e000d classdesc [cd 0x7e0006: name [B uid -5984413125824719648]: [arraycoll sz 16 -44, 29, -116, -39, -113, 0, -78, 4, -23, -128, 9, -104, -20, -8, 66, 126] [String 0x7e000e: "gradle.properties"] [array 0x7e000f classdesc [cd 0x7e0006: name [B uid -5984413125824719648]: [arraycoll sz 16 16, -69, 118, 80, -49, -19, 41, -8, 56, -86, 64, -63, 112, -14, 98, 47] [String 0x7e0010: "app/build.gradle"] [array 0x7e0011 classdesc [cd 0x7e0006: name [B uid -5984413125824719648]: [arraycoll sz 16 -3, -11, 63, -26, 67, -41, -100, 33, 85, -59, -49, -3, -90, 53, -106, 94] field data: 0x7e0003/java.util.HashMap: threshold: 12 loadFactor: 0.75 ] [instance 0x7e0002: 0x7e0000/com.android.tools.idea.gradle.project.ProjectBuildFileChecksums field data: 0x7e0000/com.android.tools.idea.gradle.project.ProjectBuildFileChecksums: myFileChecksums: r0x7e0004: java.util.HashMap _h0x7e0004 = r_0x7e0003; myLastGradleSyncTimestamp: 1522297024540 ] //// END instance dump $
You can see the following strings in java.util.HashMap
.
Wh0 has clarified the same result on Android Studio 3.2 Preview.
https://wh0.github.io/2018/02/17/build-file-checksums-ser.html
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
.
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:
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
All files in your .idea folders are related to your IDE (Android studio in this case). And as you said this files is created at the opening of the project. So you should add this file to your .gitignore because these files can contains some contents that is not necessary like your absolute path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With