Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Making Android Symbols Package smaller

Discussion in 'Android' started by Tomas1856, May 14, 2021.

  1. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    2,674
    Hi,

    since there are a lot of posts complaining about Android Symbols package being too big, here are the small instructions on how to make them smaller.

    Note: In 2021.1, there's an improvement in regards to symbol packaging, where you can select to only zip Public Symbols, also the symbols will have .so extension

    There are two reasons why symbol package is so big in Unity 2020 or lower:
    • The zip is created with Store method (meaning no compression is happening)
    • Both public and debugging symbols are included
    • While not affecting the size, the public symbols have .sym.so extension, while Google wants .so extension.
    To make symbol package smaller:

    • Extract symbol zip package
    • Delete all files ending with .dbg.so extension
    • Rename .sym.so extension to so. For ex. libunity.sym.so should become libunity.so
    • Rezip

    Alternatively, I attached a helper script to this post, place it in Assets/Editor folder. Then from menu pick Android Symbols->Shrink, it will perform the steps I described above automatically.

    Hope that helps
     

    Attached Files:

  2. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,534
    Very handy script, thanks :)
     
  3. poliman

    poliman

    Joined:
    Feb 5, 2015
    Posts:
    23
    Great job, from 1,5GB to 190MB Thx
     
    Tomas1856 likes this.
  4. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    853
    Hi @Tomas1856. Can u provide me the script that integrate this AndroidSymbolShrinker into platform android package? As long as I choose Public create symbols it will go through AndroidSymbolShrinker as last step. Btw is there any plan to backport this feature to 2020.3 LTS that will work just like 2021.1?

    upload_2021-6-15_23-15-35.png
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    2,674
    No, there are no plans to backport this change to 2020.3. Also, in this case, if you want to apply this as post processing step, you would need to do it yourself.

    Alternatively, you can query Unity support - https://unity.com/products/unity-core-support

    Hopefully that helps.
     
    Last edited: Jun 15, 2021
  6. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    853
    @Tomas1856 Can I know what is blocking it from backport this change to 2020.3? Is that something big changes related to android gradle?
     
  7. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    2,674
    Only bug fixes or critical changes are usually backported, in this case, this is considered an improvement, thus it doesn't qualify for backporting.
     
unityunity