Search Unity

Massive Android APK

Discussion in 'Android' started by furrysalamander, Apr 21, 2014.

  1. furrysalamander

    furrysalamander

    Joined:
    Oct 12, 2013
    Posts:
    3
    So after searching for a free and working solution to put GPS and maps in my unity app, I compiled the source code from here into a .exe, resulting in a file size of 17 MB, but when I compiled it into an APK, it resulted in a 70+ MB file! I have no idea why the APK is so huge! There's no way I can publish my game if it's this big because users will delete it first thing to fee up space! Any idea what's going on here?
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    Well extra baggage gets included with the APK that the EXE doesn't have to include, like things windows can do by default I guess or some similar explanation. Anyway to lower your APK size try changing compression settings of textures, uncompressed means more size, and maybe slim down on the resolution of certain textures if you can. Maybe resample sounds or change to smaller footprint format if possible. I suppose some people have probably covered this topic before:

    https://docs.unity3d.com/Documentation/Manual/iphone-playerSizeOptimization.html (for iphone but applies to android as well)

    I think this part in particular:

    Code (csharp):
    1.  
    2. Simple Checklist for Making Your Distribution as Small as Possible
    3. Minimize your assets: enable PVRTC compression for textures and reduce their resolution as far as possible. Also, minimize the number of uncompressed sounds. There are some additional tips for file size reduction here.
    4. Set the iOS Stripping Level to Use micro mscorlib.
    5. Set the script call optimization level to Fast but no exceptions.
    6. Don't use anything that lives in System.dll or System.Xml.dll in your code. These libraries are not compatible with micro mscorlib.
    7. Remove unnecessary code dependencies.
    8. Set the API Compatibility Level to .Net 2.0 subset. Note that .Net 2.0 subset has limited compatibility with other libraries.
    9. Don't use JS Arrays.
    10. Avoid generic containers in combination with value types, including structs.
    11.  

    Oh and see this unity answers thread:

    http://answers.unity3d.com/questions/153065/file-size-is-far-too-big.html
     
    Last edited: Apr 21, 2014
  3. furrysalamander

    furrysalamander

    Joined:
    Oct 12, 2013
    Posts:
    3
    Thanks for the help. You don't mind taking a look at the actual source, do you? I get that there are various things you can do to decrease size, but this seems far more blown out of proportion than your typical unity project.
     
  4. furrysalamander

    furrysalamander

    Joined:
    Oct 12, 2013
    Posts:
    3
    Hey, nevermind, but thanks for your help. I found 67 MB of assets I won't be using, so I cleared them out and now I'm just over 9 MB, well within the reasonable size for apps.