APK expansion files in Unity
Learn how APK expansion files work in Unity and how you can create main and optional patch APK expansion files for your application.
Read time 2 minutesLast updated 21 days ago
This page describes how APK expansion files work in the context of a Unity Android application.
Unity can automatically split an application into a main APK and a single APK expansion file that uses the file extension. In Unity, this process is called splitting the application binary. The APK expansion file this process generates is the main APK expansion file and if you want to create the patch APK expansion, you must do that manually.
.obbCreate the main APK expansion file
To create the main APK expansion file for your application, indicate to Unity to split the application. For information on how to do this, refer to Splitting the application binary.
Now when you Build the application, Unity generates the APK and the main APK expansion file then copies them both to the output directory. Unity uses the name of the application followed by for the name of the APK expansion file. For example, if the application is called , the APK will be and the APK expansion file will be .
.mainmy-appmy-app.apkmy-app.main.obbIf the application starts and it can’t find and load the main APK expansion file, only the first is available. In this case, try to download the APK expansion file. For more information, refer to Download process.
Scene
?
Create the patch APK expansion file
Unity only automatically creates the main APK expansion file, but you can manually create the patch APK expansion file if the application requires more storage space. For information on how to create the patch APK expansion file, refer to Android's Development checklist documentation.
APK compatibility
When you create the patch expansion file, you must include a file within it so Android recognizes the APK expansion as being compatible with the APK. To do this:
unity_obb_guid- Find the main APK expansion file that Unity generates. It's a zip archive.
- Extract the files from the APK expansion zip archive.
- In the list of extracted files, find the file.
unity_obb_guid - Copy this file over to the patch expansion file.