Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

APK build size

Discussion in 'Editor & General Support' started by Lostrick, Dec 22, 2017.

  1. Lostrick

    Lostrick

    Joined:
    Jan 9, 2014
    Posts:
    32
    Hey guys, I wanna ask something about APK build size from unity
    so I have 2 projects and the one with more textures size have smaller apk size rather than the one with less textures, and the difference is big. Am I doing something wrong here? these 2 projects are completely different but both are 2D game. Both are build only for Arm CPU. Not development build, nothing in resources and streaming folder.
    below is the log screenshoot



     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I'd guess that the textures you used in your 2nd project are much more compressible in a ZIP file. APK files are just JAR files which themselves are just ZIP files. The uncompressed file size of something doesn't have much to do with how well that file can be compressed. For example if you included a text file in your build with a trillion of the same character, that would show as quite large in that Build Report, but would compress to almost nothing when it gets into the APK.

    For more information, research how file compression works, specifically how it applies to ZIP files.
     
  3. Lostrick

    Lostrick

    Joined:
    Jan 9, 2014
    Posts:
    32
    I see, is there anyway to know the size after compress for each image? I'm trying to find what's causing the big file size, and I always thought the editor log is the way to go
     
  4. Gold_Rush

    Gold_Rush

    Joined:
    Jan 10, 2018
    Posts:
    64
    Hi! Youre "Build Report" not include sizes of included files?

    Usually im look Editor.log file after Build and find "Used Assets and files from the Resources folder, sorted by uncompressed size". There will be a list like this:

    It can help to find much problem and big textures.
     
  5. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279
    What's actually happening is that in one project you set your textures to compress, and in the other you didn't, if you look at the textures properties in unity you can setup this stuff for each texture/platform, you can also lower their resolution and get even more compression.

    There's also the issue where you might have created sprite packs, which might also save space.