Search Unity

Huge app sizes with Unity Android

Discussion in 'Android' started by beezir, Nov 20, 2010.

  1. beezir

    beezir

    Joined:
    Apr 3, 2009
    Posts:
    133
    My current app compiles into a 7mb APK file, but once installed claims to use up 18mb. Considering that I'm using fairly limited assets, compression, stripped binary, and no 3d models at all, I'm really confused as to why this needs to take up so much space. For comparison, Angry Birds claims to come in at under 2mb.

    EDIT: Also for comparison, a completely empty project weighs in at 4.5mb, but once installed reports itself as 13.5mb.
     
    Last edited: Nov 20, 2010
    ozgurdugmeci likes this.
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Thats normal, as the unity engine and mono together weight up that far.
     
  3. Dan Fury

    Dan Fury

    Joined:
    Jul 18, 2010
    Posts:
    158
    Yeah and it's bad, I would prefer a single time download/plugin like air, that shares all the Unity data with our apps.
    You can usually spot a Unity app pretty fast, because of the bloated filesize.
    I move all my games to SD Card and Unity always leaves 9MB on the device, which means for every Unity game I'd like to keep, I have to kick around 20-50 other games. You usually only have between 120 and 200 MB for apps, so every Unity game claims ca. 5-10% of my device. The other way to handle it as far as I know would be the way Air is doing it, if you install an Air app, you get a message that you need to download Adobe Air and it links directly to the market.

    Both ways have their pros and cons, most people won't like another plugin or installed app on their device and if they leave it like it is now, every Unity game consumes at least 10% device memory on current models.

    Maybe a mix would be possible, that would be ideal. The perfect solution in my opinion would be if there was an asset server, where we could upload our game files. Then the apk would be very small and would download additional data on the first start. If the plugin is already installed, it won't need it again and if not, there would be no extra app download, it would store the Unity files in the application, which then must share all the Unity files to other Unity games through intents.
     
    Last edited: Nov 20, 2010
  4. beezir

    beezir

    Joined:
    Apr 3, 2009
    Posts:
    133
    I figured the engine and runtime libraries probably took up a decent chunk. I'm very curious, however, why a 4mb APK turns into a 13mb install? Is it just that it's decompressed after install?
     
  5. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    In all fairness the 2MB for Angry Birds is when installed to the SD card; move it to the internal phone memory and it comes in at about 14.5MB.
    So, the 2MBs for Angry Bird should be compared to the 9MB for Unity, in terms of executable binary size, when installed to the SD card. Huge? Yes. Are we trying to remove a large chunk of that? Yes. Is this all because of Froyo not supporting executable binaries on the SD card? Yes.
     
  6. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    There are actually other ways to solve the problem without relying on an external plugin (a plugin would have the added downside similar to what we have the webplugin right now). We are exploring those other ways right now.
     
  7. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    That is actually explained in the sticky thread on forum, here.

    Essentially yes; the executable binaries need to be decompressed at install time, and they need to reside on the internal phone memory, even with Froyo's app-on-sdcard feature. That is a limitation imposed by the OS, not something we made up. Everything else (i.e. your data and script assemblies) is not decompressed and that is what is stored on the sd card.
     
  8. beezir

    beezir

    Joined:
    Apr 3, 2009
    Posts:
    133
    Thanks Erique, I had not noticed that Angry Birds was moved to SD. Should have known that was an absurdly small install for that size game.
     
  9. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Angry Birds results over 14 MB to me...
     
  10. Noxury

    Noxury

    Joined:
    Mar 8, 2015
    Posts:
    22
    My app consists of 1 scene using 2D with 2 Objects and it is 47,11 mb large. I never have read this kind of amount on the forums before. Strange...
     
    Last edited: Aug 18, 2015
  11. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Check your Resources or StreamingAssets folders. Even if it's not in the scene, Unity will include it in the build.