As you can see from the Build Report(For Android Build):
Build Report
Uncompressed usage by category (Percentages based on user generated assets only):
Textures 14.6 mb 33.0%
Meshes 3.7 mb 8.4%
Animations 640.0 kb 1.4%
Sounds 570.7 kb 1.3%
Shaders 3.2 mb 7.2%
Other Assets 21.1 mb 47.7%
Levels 0.0 kb 0.0%
Scripts 304.4 kb 0.7%
Included DLLs 0.0 kb 0.0%
File headers 121.9 kb 0.3%
Total User Assets 44.2 mb 100.0%
Complete build size 2.2 gb
The “Total User Assets” are only 44.2 mb but the complete build size is 2.2 gb.
Why is this? Also the Apk I made is 874 MB which is quite large for a low poly and optimized game.
Are you using Addressables, Streaming Assets, or copy files to the build in other ways? Those will count towards the “Complete build size” but won’t show up in the breakdown.
You could implement OnPostProcessBuild, which gives you a BuildReport that contains information and sizes of the files in the build. I guess this is where the paid reporting tools get their data from.
You can also just unzip the apk/abb and check which files inside take up all of the space. I e.g. have the issue that local Addressables group files accumulate in successive builds, bloating the size. You’ll only discover issues like that by inspecting the actual build data.
The question is about the discrepancy between the “Complete build size” and what Unity counts as “User Assets”. Unity cannot know if a scene is unused and would still count it and everything it references as user assets. Unused Assets are not included in builds, unless their in a Resources folder, in which case Unity again cannot know if they’re actually unused and should still count them as user assets.
Then analyzing the actual build would be best. Rename the APK/ABB file extension to ZIP, extract it, and use something like WinDirStat to see where the missing GBs are coming from.
This Unity Hacking Guide has some details on what the important files in the build are and some tools you could use to see what they contain.
After unzipping the file, I found out that the “lib” folder comprises 121 MB and the “assets” folder comprises 816 MB. These two are the main contributors.
The “lib” folder contains the code, both Unity’s native code (“libunity.so”) as well as converted C# code (“lib_burst_generated.so” and “libil2cpp.so”). You could try reducing the size of the second by removing unused code and packages in your project or by increasing code stripping.
The “assets” folder contains all the non-code assets. You have to dig into it to see how the size is distributed. The “bin/Data” subfolder contains your scenes (“levelX”, including assets only used in that scene), “sharedassetsX.assets” (assets used by multiple scenes) and assets from Resources (the files that have only a hash as name).
Does the “assets” folder contains anything besides the “bin/Data” folder?
Maybe because .aab is a container that contains multiple versions of your app for different architectures. When downloading from the store, there will be a correct size for the user.
I believe that you can see it in the Play Developer Console after uploading.
For testing purposes, you can disable Build App Bundle (Google Play) in Build Settings, and generate APK instead of AAB, and check the size.