Search Issue Tracker
Third Party Issue
Votes
0
Found in
2021.3.47f1
2022.3.54f1
6000.0.31f1
6000.1.0a8
Issue ID
UUM-90846
Regression
No
[Android] The APK is bloated after generating it with the Application Binary Split enabled when immediately before an APK was generated with Application Binary Split disabled
How to reproduce:
1. Open the “SimpleAPKObbBloat.zip“
2. Open the “SampleScene“
3. In the script “Assets/Editor/Test.cs” change the “arguments["outputPath"] =” path to the valid path in the macOS (For Windows skip this step)
4. Click on the “MyMenu/RunTest“ on the topbar
5. Navigate to the valid path on your macOS (for Windows: “C:\\apkobbtest
LocalBuild.apk“)
6. Observe the “LocalBuild.split.apk“ size
Expected result: The “LocalBuild.split.apk” size is not bloated and is around 40 MB
Actual result: The “LocalBuild.split.apk” size is around 700 MB.
Reproducible with: 2021.3.47f1, 2022.3.54f1, 6000.0.31f1, 6000.1.0a8
Reproducible environment: macOS 15.1.1 (Intel), Windows 10 Pro (22H2)
Not reproducible environment: No other environment tested
Workaround: Add
“
PlayerSettings.Android.useAPKExpansionFiles = true;
buildSettings.options |= BuildOptions.CleanBuildCache;
“
Notes:
- Note that the file size of 'LocalBuild.apk” file is around 700+ MB and the file size of “LocalBuild.split.apk” is also around that size as well but the size for “LocalBuild.split.apk” should be around 30+ MB because the contents have been moved to the OBB file
- Must have an Android module to reproduce
- After the workaround to reproduce the issue either un-zip the project again
Clean build solves the issue, seems to be something like cache issue
Reproducible only when building APK/APK+OBB, AAB works fine
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
This problem is reproducible only if building development builds. When building release builds (where size really matters), everything is fine. The problem is not Unity specific, it's just the way how Gradle (or AGP) generates debug APK, most likely it tries to re-use previous APK if it exists.
This problem can be reproduced in Android Studio using these steps:
- create an empty project in Android Studio
- copy some relatively large (~100Mb) zip file to app/src/main/assets/bin
- build debug APK (app/build/outputs/apk/debug/app-debug.apk), it's size would be slightly larger than 100Mb
- delete this zip file
- build debug APK again, it's size would still be almost the same