Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
7
Question by Sector11 · Aug 05, 2011 at 09:06 AM · androidmemoryapkfilesize

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.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Aug 05, 2011 at 04:19 PM 0
Share

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

avatar image dbdev · Apr 16, 2014 at 06:49 AM 0
Share

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?

avatar image Darioszka · Mar 06, 2016 at 11:39 AM 0
Share

Yes it fixed my problem. From size 19 to 11!

8 Replies

· Add your reply
  • Sort: 
avatar image
23
Best Answer

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").

Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Sector11 · Aug 06, 2011 at 12:43 PM 0
Share

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?

avatar image Waz · Aug 06, 2011 at 09:26 PM 0
Share

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.

avatar image Sector11 · Aug 06, 2011 at 10:12 PM 0
Share

These are the DLL's I found:

Boo.Lang.dll, $$anonymous$$ono.Security.dll, System.dll, UnityScript.Lang.dll, mscorlib.dll, Assembly-UnityScript.dll

avatar image Waz · Aug 06, 2011 at 10:47 PM 0
Share

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
avatar image unimechanic ♦♦ · Feb 25, 2013 at 01:07 PM 1
Share

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.

avatar image zukinet unimechanic ♦♦ · Jul 29, 2017 at 04:05 AM 0
Share

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...

Show more comments
avatar image
5

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

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.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Sector11 · Aug 06, 2011 at 08:47 AM 0
Share

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.

avatar image
1

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 :)

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Sector11 · Aug 05, 2011 at 11:09 AM 0
Share

well that's really small. But the size of the apk file is not the size of the actual game or is it?

avatar image kaloss · Aug 05, 2011 at 11:26 AM 0
Share

the size of the game is another story. about > 25mb, but they are on your SD card, so that is not a big problem.

avatar image Sector11 · Aug 05, 2011 at 12:04 PM 0
Share

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

avatar image
-2

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.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Aug 05, 2011 at 04:13 PM 2
Share

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`"

avatar image Meltdown · Aug 05, 2011 at 04:21 PM 0
Share

Ooh ok, my bad :/ Thought build size stripping included unused assets for some reason.

avatar image Sector11 · Aug 06, 2011 at 08:43 AM 0
Share

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.

  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges