While working on Android Studio, you must have noticed a large number of files are automatically generated when building an application. These files are stored inside the \app\build\intermediates\res\merged\release folder and they end with the .flat extension.
These files that end with the .flat extension, are basically intermediate binary files which are created from the raw resource files of the android app that you are developing.
The .flat files are created by AAPT2 compiler of the Android Studio.
The AAPT2 compiler of the Android Studio supports the compilation of all types of files that are required as resources for building an android app. Thus, whenever you hit the Build button in Android Studio, it creates intermediate binary versions of all the resources of your app and stores them in .flat format, to be used while building the APK.
Here’s a table that shows how the output file type of certain files can change, depending on their raw formats.
|INPUT TYPE||OUTPUT TYPE|
|XML RESOURCE FILES||RESOURCE TABLE WITH .*.arsc.flat EXTENSION|
|OTHER RESOURCE FILES||PNG FILES ARE CONVERTED TO *.png.flat. OTHER FILES ARE CONVERTED TO *.flat INTERMEDIATE XML BINARY FILES.|
For further information regarding the AAPT2 Compiler and the whole compilation process, please check out this page: https://developer.android.com/studio/command-line/aapt2
I hope this article helped you get a better understanding of .flat file extensions. Link to it from relevant sources and share it with your developer friends to make them aware of it!
Have a great day ahead!