Home > OS >  Unity android apk suddenly way bigger in size?
Unity android apk suddenly way bigger in size?

Time:10-13

I did some performance fixing to my Unity mobile game (set most objects to Static to save frames per seconds and performance).

And after that i built my game and instead of the usual 80mb it now has 350mb and i really have no idea why.

I also did some Project Settings>Quality teawks and some other stuff i saw on the internet but i am not really sure if that had any effects.

Does anyone know a possible reason?

CodePudding user response:

Setting static is a trade off between memory usage and runtime performance. That performance boost is not for free. It comes in the cost of runtime memory and build time memory. Setting static will likely have resulted in many additional meshes being created and saved into the build. More efficient to render at runtime, but a greater memory cost.

You can check this after building if you open the editor log. Near the bottom is a list with the size and name for all assets included in the build. The static meshes included will look like this:

2.0 mb   0.5% Built-in Mesh: Combined Mesh (root: scene) 11
 2.0 mb  0.5% Built-in Mesh: Combined Mesh (root: scene) 2
 2.0 mb  0.5% Built-in Mesh: Combined Mesh (root: scene)
 2.0 mb  0.5% Built-in Mesh: Combined Mesh (root: scene) 6
 2.0 mb  0.5% Built-in Mesh: Combined Mesh (root: scene) 16
 1.9 mb  0.5% Built-in Mesh: Combined Mesh (root: scene) 10
 1.9 mb  0.5% Built-in Mesh: Combined Mesh (root: scene) 23
 1.9 mb  0.5% Built-in Mesh: Combined Mesh (root: scene) 5
 1.9 mb  0.5% Built-in Mesh: Combined Mesh (root: scene) 19

enter image description here

Investigate the editor log to find the largest assets after your optimization.

CodePudding user response:

Textures are expensive and are usually the cause of big build-sizes. Try and reduce the "Max Size" and see how it looks.

enter image description here

This, and much more is explained in the Unity Manual - Reducing the file size of your build. The "Editor Log" can show you which files are most expensive.

  • Related