Search Unity

apk size of empty scene is 20Mb, after installation on phone its 62Mb

Discussion in 'Android' started by Moshe_k, Jan 27, 2017.

  1. Moshe_k

    Moshe_k

    Joined:
    Jan 27, 2017
    Posts:
    6
    tried to reinstall unity and reset settings, when I build a game from a completely empty project, empty scene, i get an apk of 20 Mb, after installation on phone the app takes 62Mb.
    I checked the editor log but couldn't figure out anything meaningful out of it.

    I Will be so thankful for even a hint as to why this is happening..
     
  2. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    that is because generally, APKs are compressed a bit. That's why Pokemon GO comes out at 100MB+ but the download is only 40.

    Plus, if you're caching a little bit of stuff, that adds to it as well.
     
  3. Moshe_k

    Moshe_k

    Joined:
    Jan 27, 2017
    Posts:
    6
    Thank you Fuzzy, appreciate it!
    Its just that wile searching for a fix to this problem (which might not be a problem like you said) i saw people that have apk's 10 Mb big and installed they are 20 Mb.

    This happens for an EMPTY project, no game object nor scripts.. ):
    Am i too big or is this size normal ?
     
  4. lloydg

    lloydg

    Joined:
    Mar 23, 2015
    Posts:
    36
    You get about half that size if you only compile for ARM or x86, by default it does both into a single binary / apk
     
  5. Moshe_k

    Moshe_k

    Joined:
    Jan 27, 2017
    Posts:
    6
    Still getting 52 Mb for an empty project, no objects and no scripts when building in ARM only.
    is this an exotic problem? not a common one?
     
  6. lloydg

    lloydg

    Joined:
    Mar 23, 2015
    Posts:
    36
    so it just dropped 10 mb? thats about all you will save when going to ARM only. although 52mb is to big, I have a small puzzle game, only takes 32mb on the phone after installed.
     
  7. Moshe_k

    Moshe_k

    Joined:
    Jan 27, 2017
    Posts:
    6
    yeah i think i f'ed something while copying projects or messing with something. ill try a different machine.. thanks for the 32Mb reference
     
  8. mostafaibrahim

    mostafaibrahim

    Joined:
    May 1, 2017
    Posts:
    2
    i am really sad i make an empty 2D project with unity , just empty scene and the apk size is 20 MB
    i need a fix please
     
  9. ramd990

    ramd990

    Joined:
    Nov 20, 2017
    Posts:
    1
    You Can optimise to 11 Mb ,By setting the device filter Go to PlayerSettings Change Device filter to ARMV7
    Screen Shot 2018-03-15 at 12.03.20 PM.png
    This can fix for u
     
  10. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    When installing an APK, the PackageManager extracts native libraries from it and installs them to a specific location. This ends up with "on phone" size being larger than the APK size. The difference should remain constant so it's not that critical for a non-empty app.

    Alternative is to use extractNativeLibraries=false flag: https://developer.android.com/topic/performance/reduce-apk-size.html#reduce-code, section "Avoid extracting native libraries". However your APK size is going to be significantly larger; if that's acceptable, you are going to have "on phone" size very close to the APK size.
     
  11. Netuddmeg

    Netuddmeg

    Joined:
    Mar 2, 2018
    Posts:
    14
  12. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
  13. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    I can say: with U4.7 i get i file size about= 7,27mb APK !!! pretty great !!!
    Again with U5.6 and with REALLY optimal player settings, i get = 10,0mb APK :(. And i guess with U2017 & U2018 it gets more worst ! :(. Don´t know why Unity is making it more bad.

    Conclusion: old Unity 4.7 is much better in filesize and also in performance !
     
    Last edited: Apr 1, 2018
  14. hari2015

    hari2015

    Joined:
    Dec 10, 2014
    Posts:
    4
    I got 8.30mb on U4.7 ... How you got 7.27mb

    On U5.5 I got 9.5mb
     
  15. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    For the test, an empty scene. Than turning everything off, that is not needed. Like, Gi-baking, etc. I use Net Sub-set which results in a smaller size, in comparison to the normal net.