- Home /
File size is far too big!!
Hello! I have a little problem with the file size of my android game. The game is made of only 1 scene with 1 camera, 1 directional light, 4 cubes, 1 plane, 4 javascripts and 2 materials. But the file size of the .apk file is already 7 MB and when I load the game on my android device it takes 19,45 MB. Now the question is, how is that possible and what can I do to minimize the size of the game? If anyone knows the answer please reply.
Don't forget that your build is more than just your assets. The build includes the "whole" Unity3D engine with all features including the mono library.
See this page for more information:
http://unity3d.com/support/documentation/$$anonymous$$anual/iphone-playerSizeOptimization.html
Agreed, here's my experience: I build the same project into iOS, just moments after building into Android, without changing the project, here's the sizes:
Android: 21.86$$anonymous$$B iOS: 64 bytes (I did not forget the mega part) :D
I guess maybe Android needs a player and iOS doesn't?
Answer by Waz · Aug 06, 2011 at 09:11 AM
Check the Editor Log (button in top-right of Console window), after building.
Scroll to towards the end of this text file and you will see a section like this:
***Player size statistics***
Level 0 'Assets/Loader.unity' uses 459.0 KB compressed / 1.6 MB uncompressed.
Level 1 'Assets/Game.unity' uses 2.3 MB compressed / 7.8 MB uncompressed.
Total compressed size 2.8 MB. Total uncompressed size 9.4 MB.
Textures 3.9 mb 41.2%
Meshes 2.3 mb 23.9%
Animations 679.1 kb 7.0%
Sounds 0.0 kb 0.0%
Shaders 538.1 kb 5.6%
Other Assets 653.8 kb 6.8%
Levels 147.8 kb 1.5%
Scripts 453.3 kb 4.7%
Included DLLs 136.0 kb 1.4%
File headers 747.4 kb 7.8%
Complete size 9.4 mb 100.0%
Used Assets, sorted by uncompressed size:
277.1 kb 2.9% Assets/Player/Human.blend
264.1 kb 2.7% Assets/Player/Orc.blend
216.1 kb 2.2% Assets/Monsters/Foo.blend
213.0 kb 2.2% Assets/Dungeon/Dungeon.blend
170.8 kb 1.8% Assets/Monsters/FooSkin.png
...
Yes, Unity should make this critical information way more obvious!
Sometimes it's as simple as a texture you have forgotten to downscale, or a model that needs to have Compression turned on (model and/or animation). Sometimes you've inadvertently depended upon an expensive DLL (like XML). Sometimes a package you're using (like Detonator) has a lot of big unused Resources (unused mere assets don't matter).
Note on the above sizes: these are for a WebPlayer; unlike Android and iOS, web builds don't have to include the Player, since the user installs that separately (I suspect that's actually the entirety of your "problem").
Thank you for your answer. I took a look already and I have seen that the Included DLL's need 3.8 $$anonymous$$B (77.3%). Is there a way to $$anonymous$$imize that?
The list of included DLLs is just above the size info. What are yours? You can $$anonymous$$imise only by not using them. eg. X$$anonymous$$L is 1$$anonymous$$ or so, so people use alternative X$$anonymous$$L libs.
These are the DLL's I found:
Boo.Lang.dll, $$anonymous$$ono.Security.dll, System.dll, UnityScript.Lang.dll, mscorlib.dll, Assembly-UnityScript.dll
These are core player DLLs:
Boo.Lang.dll, System.dll, UnityScript.Lang.dll, mscorlib.dll
This is your code built into an assembly:
Assembly-UnityScript.dll,
Unless this is Android-specific, this is something you depend on:
$$anonymous$$ono.Security.dll
We have recently received this question about File headers, and we are in the process of enhancing the documentation. I'll copy the answer here since it will help other users searching for this our community:
File headers is data that is kept maintaining references and settings for the assets, such as resource assets. It is the amount of extra data apart from the "raw" data contents in a file. Do you have assets in the "Resources" folder? You can try moving some or all files out of this folder and see if that reduces the file headers.
Hi @unimechanic, in Unity Cloud Build. This information should have special place so i dont need to scroll down and search it in full Log...
Answer by leoncorrl · Jan 18, 2016 at 10:08 AM
Hello an excuse my English. You can reduce you build in 6 -12 mb
Enter the player setting-> Other Setting- > Change filter device (FAT (AMRv7x86)) to ARMv7. With this you can reduce the size of you build and remember compress and override all PNG,JPG images in you scene
Answer by Minerne · Aug 05, 2011 at 04:42 PM
Check the sizes and settings for your assets. Textures can take up a significant amount of space, and the quality of those textures does make a difference. Lowering the quality can dramatically reduce the size of your project.
Also, make sure you remove any unused assets.
When I checked the size for the first time I didn't have even one texture. the size of the assets folder was about 370 $$anonymous$$B. But the size of the .apk file was 7 $$anonymous$$B already.
Answer by kaloss · Aug 05, 2011 at 10:37 AM
that's normal. The size won't change much. My current project size: 300MB. Unity basic builds a 11MB apk file for me, and I'm happy with it :)
well that's really small. But the size of the apk file is not the size of the actual game or is it?
the size of the game is another story. about > 25mb, but they are on your SD card, so that is not a big problem.
but that cant be the solution. I mean, my game is really simple and needs only 3 $$anonymous$$B less memory than Angry Birds which is 2D but for sure much more complex
Answer by Meltdown · Aug 05, 2011 at 09:08 AM
Remove any un-needed assets from your assets folder. Unless you have PRO, Unity will not do this automatically for you.
That's absolutely not true! Unity will only include those assets in the build that are used / referenced by any of the included scenes.
$$anonymous$$aybe you've meant code-stripping but that's something totally different. You can have 5TB of assets in your project but when you don't use them they doesn't hurt (except the loading time in the editor :D)
When you created a build, open the editor-log (the little button at the top right in the console-window). There's a detailed list of all inclued assets and even a statistic from the biggest asset to the smallest. Just search for "`Player size statistics`"
Ooh ok, my bad :/ Thought build size stripping included unused assets for some reason.
Now I took a look at the editor-log and it says that nearly 73% are Included DLL's (3.8 $$anonymous$$B). Textures 20%. The size of the .apk is 7.7 $$anonymous$$B.
Your answer
Follow this Question
Related Questions
Android game too heavy after installation! 0 Answers
Sprites increase android apk size 2 Answers
How can i connect the smartphone's photogallery with app just build? 0 Answers
Unity Android app crashes when activated a few times with Android's SDK's startActivity(intent). 1 Answer
How much RAM does textmesh use? 1 Answer