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

Bug APK size increased in 2021.2

Discussion in 'Android' started by DevDunk, Nov 3, 2021.

  1. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    I am making a VR game for the Oculus Quest, only based on the XR management, without other plugins.
    My game was 27MB previously. I upgraded to 2021.2 and not my apk is 45MB.

    Am I the only one and are there things to look at?
     
    JokeMaker and FamishedMammal like this.
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,663
    In 2021.2 Android switched to incremental build pipeline, a lot of things have changed, so it might be a bug. Could you unzip apk made with 2021.2 versus previous version, and see if there are extra new files or some files became bigger.

    Alternatively, please submit a bug with repro project attached. Thank you
     
  3. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    Yep, there are different and bigger files in 2021. Assets are slightly smaller and lib has a decent difference
    Left if 2021:
    upload_2021-11-3_14-8-10.png
    upload_2021-11-3_14-9-19.png
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    Made a bug report: Case 1377938
     
  5. Mr-Zhou

    Mr-Zhou

    Joined:
    May 4, 2016
    Posts:
    26
    I have the same problem after upgrading the project to 2021.2.5. Is there any progress on this problem?
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    Not yet, no reply to my bug report either
     
  7. Mr-Zhou

    Mr-Zhou

    Joined:
    May 4, 2016
    Posts:
    26
    Thank you for your reply, please let me know if there is a result, thank you!
     
    DevDunk likes this.
  8. Ceylan12

    Ceylan12

    Joined:
    Dec 24, 2016
    Posts:
    113
    I have the exactly same problem. Is there an any progress?
     
  9. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    The reply I got was simple that the build process changed and that a small increase can be the result. In the build logs you can find where a lot of the storage is going
     
    Ceylan12 likes this.
  10. Ceylan12

    Ceylan12

    Joined:
    Dec 24, 2016
    Posts:
    113
    Thank you for the reply. I'm gonna investigate apk more but I have a +20mb on the build.
     
    DevDunk likes this.
  11. arufolo

    arufolo

    Joined:
    Mar 5, 2013
    Posts:
    8
    Any update on this? Upgraded from 2019.4 to 2021.3 and our APK went from just over 1GB to 3GB. This is unacceptable.
     
    wellovate likes this.
  12. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    Maybe check build logs?
     
  13. wellovate

    wellovate

    Joined:
    Aug 2, 2017
    Posts:
    1
    Anything in particular to look out for in the build logs?
     
  14. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    What takes up space
     
  15. MaximPP

    MaximPP

    Joined:
    Jan 26, 2019
    Posts:
    72
    my apk size increased from 82 to 96 MB when I upgraded from 2020.3 to 2021.3
     
  16. MaximPP

    MaximPP

    Joined:
    Jan 26, 2019
    Posts:
    72
    Can you give a link?
     
  17. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    It wasn't made into a case, but here is the reply:
    Hi Dylan,

    Thanks for reporting the issue.

    I have checked the project you provided and the size increased by 10 megabytes when upgrading from 2020.3 to 2021.2, this however, is not the case with a completely new project where the size increased only by a few megabytes. So the increase in size is more related to the project rather than upgrading Unity, however, keep in mind that with every new main Unity version e.g 2021.X and 2022.X new features are added and functionalities are slightly changed/modified.

    You can check here on how to reduce the size of your builds: https://docs.unity3d.com/Manual/ReducingFilesize.html

    Thanks,
    Haroldas
    Customer QA Team
     
  18. MaximPP

    MaximPP

    Joined:
    Jan 26, 2019
    Posts:
    72
    I checked the build files. The 2021.3 update increased the size of the libil2cpp.so file.
     
  19. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    Yep, that be unity stuff. You can increase il2cpp code striping in player settings and put the builds at faster (smaller) builds im build settings
     
  20. karlmarxbl6

    karlmarxbl6

    Joined:
    Jun 25, 2022
    Posts:
    1
    Same happened to me. Is there any progress?
     
  21. adfocardi

    adfocardi

    Joined:
    Dec 5, 2016
    Posts:
    1
    same Problem,, anyone have solution ??
     
  22. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    Uninstall any unused packages and build for small size
     
  23. evuslu

    evuslu

    Joined:
    Feb 26, 2013
    Posts:
    9
    My previous build (it should be build with 2019) is 52.5 Mb(.aab) file. When i uncompress total folder size is 225.6 Mb.
    My new build(2021.3.10f1) is 105.6 Mb(.aab) file. Uncompressed size is 194 Mb.(Compression method Default or LZ4HC not changed this numbers too much).

    Uncompressed sizes almost same but compressed .aab files has huge difference. Even i compressed both folders still 2021 build has double size. I don't know the logic on compressing progress but somehow Unity 2021 build files for Android could not be compressed as good as 2019 build files.
     
  24. evuslu

    evuslu

    Joined:
    Feb 26, 2013
    Posts:
    9
    .aab file : base/assets/bin/Data

    Unity 2021 has one file data.unity3d
    Unity 2019 has a lot of file for data.

    data.unity3d -> might have some kind of compression and second compression on this file might not work well.
     
  25. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    Tried removing unnecessary packaged and enabled shader striping etc?
    If so, maybe make a bug report and attatch this post
     
  26. evuslu

    evuslu

    Joined:
    Feb 26, 2013
    Posts:
    9
    My build have slightly different but i think it's clear that new Data folder is not good for compressing.

    When i compressed Data folder inside aab file:
    Unity 2019 : 153 Mb(Uncompressed) -> Compressed : 27 Mb
    Unity 2021 : 88Mb(Uncompressed) -> Compressed : 67 Mb
     
  27. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,404
    I know. My reply stays the same
     
  28. evuslu

    evuslu

    Joined:
    Feb 26, 2013
    Posts:
    9
    Ok, here is my fault :)

    1 - In 2019 i was using old sprite packer and when i ported my project to 2021 sprite packer wasn't active.
    2 - data.unity3d : This file is only creating when i select compression method on build settings other then default.

    2019 aab file size was 52.5
    2021 aab file size is now 61 Mb which is acceptable (this might be because of my update)

    DevDunk thanks for your interest and time.
     
    DevDunk likes this.
  29. Kennai

    Kennai

    Joined:
    Nov 1, 2018
    Posts:
    27
  30. manugil

    manugil

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    40
    What Grahics API do you have set in Player Settings? Auto?
    Is there any build size change if you change it from Vulkan to GLES3?

    Thanks!
     

    Attached Files:

  31. panzerchrust

    panzerchrust

    Joined:
    May 28, 2019
    Posts:
    2
    Hi!
    After upgrading from 2020.3.41 to 2021.3.21 I managed to decrease assets size. And lib folder is less. But the resulting .apk size increased.
     

    Attached Files:

  32. HQF

    HQF

    Joined:
    Aug 28, 2015
    Posts:
    40
    any updates here? My build size increases almost twise after upgrade! What happens?
     
  33. nishu6789

    nishu6789

    Joined:
    Apr 16, 2020
    Posts:
    4
    any update on this bug? I can find the issue on unity's issue tracker