• 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
3
Question by Maxszkutron · Feb 05, 2015 at 03:01 AM · androidapk

Unity 4.6+ How to reduce .apk size

Hello,

I have just downloaded Android SDK, and tried to build a simple app, so I created new project, saved the default scene and made a build. The scene contains just the camera and nothing more, there are no assets or scripts in the project, just basic empty project without any packages imported. What I got was 14,1MB .apk file... I tried doing the same in older version of unity (4.2) and got 7,82MB .apk file.

So my questions is, how can I reduce .apk size in latest(as for now it's 4.6.2f1) version of unity, apparently there were changes in engine since v4.2 but 14MB is way too much.

Output logs from different versions:

Unity 4.2

 Textures      0.0 kb     0.0% 
 Meshes        0.0 kb     0.0% 
 Animations    0.0 kb     0.0% 
 Sounds        0.0 kb     0.0% 
 Shaders       0.0 kb     0.0% 
 Other Assets  0.0 kb     0.0% 
 Levels        8.9 kb     0.2% 
 Scripts       0.0 kb     0.0% 
 Included DLLs 3.7 mb     99.5% 
 File headers  8.1 kb     0.2% 
 Complete size 3.7 mb     100.0% 

Unity 4.6.2f1

 Textures      0.0 kb     0.0% 
 Meshes        0.0 kb     0.0% 
 Animations    0.0 kb     0.0% 
 Sounds        0.0 kb     0.0% 
 Shaders       0.0 kb     0.0% 
 Other Assets  0.0 kb     0.0% 
 Levels        9.6 kb     0.2% 
 Scripts       170.9 kb     4.1% 
 Included DLLs 3.9 mb     95.5% 
 File headers  8.2 kb     0.2% 
 Complete size 4.1 mb     100.0% 
 
 Used Assets, sorted by uncompressed size:
  3.4 kb     0.1% D:/Program Files (x86)/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.2/UnityEngine.UI.dll
 AndroidSDKTools:
 
     root          : D:/android-sdk
 
     tools         : D:/android-sdk\tools
 
     platform-tools: D:/android-sdk\platform-tools
 
     build-tools   : D:\android-sdk\build-tools\21.1.2
 
     adb      : D:/android-sdk\platform-tools\adb.exe
 
     aapt     : D:\android-sdk\build-tools\21.1.2\aapt.exe
 
     zipalign : D:\android-sdk\build-tools\21.1.2\zipalign.exe
 
     java     : java.exe


Both output logs say that complete size is about 4MB. I know that Unity Engine and Player files take some space but where additional 10MB come from?

Comment
Add comment
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

2 Replies

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

Answer by Noob_Vulcan · Feb 05, 2015 at 04:57 AM

Ok ....Just go to Project Setting-->Player

Make sure you have selected Device Filter to ARM 7 only

Because in unity 4.6 the build supports both x86 and ARM 7 by default . So its a bit fat.

Select ARM 7 and you are good to go

For More check this out http://www.unityrealm.com/how-to-reduce-apk-size-in-unity-5/

Hope this helps you

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 Maxszkutron · Feb 06, 2015 at 07:44 PM 0
Share

Thank You very much, this solved my problem

avatar image CB-InDev · Mar 30, 2015 at 11:47 PM 0
Share

I wish I can give you a 1000 thumbs up! Thanks for that tip, I just shaved 10mb off my AP$$anonymous$$ from 24mb to 14mb :) I'm still hunting a few more things to figure out why the Editor.log file shows a completed size of 9.2mb and the file itself is 14mb, but this is a big step!

If you have any more solutions or tips, let me know :)

avatar image Noob_Vulcan · Mar 31, 2015 at 05:31 AM 0
Share

@CB-InDev : Good to hear that it helped you. There are many tips but they are project specific .

One more thing if you are building for IOS then your can use ByteCode Stripping . Cheers

avatar image inakiktp · Apr 02, 2015 at 12:54 PM 0
Share

I was wondering why my AP$$anonymous$$, that should be about 11 $$anonymous$$B was 25 $$anonymous$$B, but thanks to your answer $$anonymous$$r Vulcan, my problem was solved! Upvoted ofc.

avatar image Noob_Vulcan · Jun 19, 2015 at 07:19 AM 2
Share

@Arpit Rastogi : x86 is for Intel devices . Well they hardly exists ..SO you can chill ... :)

Show more comments
avatar image
0

Answer by jinchong · Jul 28, 2015 at 06:25 PM

you can get some points regarding to optimization from this video :

https://youtu.be/TYSmf_zgtZo

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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Problems installing apk built from Android Studio 1 Answer

OpenIAB In App 1 Answer

How can I include a C++ dll in the .apk file 3 Answers

Running android app on version 4.0.3 crash? 0 Answers

Game wont open on android phone 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