in

What Is .flat Extension? | .flat Files In Android Studio

Flat Files
Flat Files

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.

.flat extension files

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 TYPEOUTPUT TYPE
XML RESOURCE FILESRESOURCE TABLE WITH .*.arsc.flat EXTENSION
OTHER RESOURCE FILESPNG 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!

What do you think?

Written by Anirban Roy

Anirban is a full-stack developer and an SEO expert. He has 6 years of experience in web development and software engineering. With a passion for writing, he has been blogging since 2017.

Leave a Reply

Your email address will not be published. Required fields are marked *