Search Unity

Does disabling packages in Packages manager yield to smaller build size?

Discussion in 'General Discussion' started by leSamo, Nov 21, 2018.

Thread Status:
Not open for further replies.
  1. leSamo

    leSamo

    Joined:
    May 26, 2017
    Posts:
    2
    Does disabling packages in Packages manager yield to smaller build size? If not, then what does it do?
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,157
    Unity's package manager is simply an alternative way to deliver assets. If you disable or remove packages from your project they will no longer be available to the package until you've enabled or added them back. Beyond that their behaviour is no different than any other asset in your project.

    If you don't use an asset, and it isn't in a folder forcing it to be included (eg Resources), then it won't be added to the build.
     
    DragonCoder and superpig like this.
  3. Etsai

    Etsai

    Joined:
    Sep 12, 2014
    Posts:
    24
    So yes. Disabling or removing packages through the Package Manager will have impact on your build size.
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,157
    Once again only if you're actively using the contents of the package or if the developer made use of a special folder (eg Resources) that is known to forcibly include its contents in a build. That said disabling or removing a package in use will have the exact same effect as deleting an asset that is in use (typically it will be an error message preventing a build).
     
    Last edited: Jan 21, 2019
  5. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,269
    Any unused package should be stripped from a build (I think/hope) but unfortunately some packages include assets like resources and/or scripts, shaders etc that get included in a build even if you do not need them there - ProBuilder and TextMeshPro I noticed for starters...
     
    JonPQ and StellarVeil like this.
  6. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,157
    Right, and it's largely the result of the game engine only having limited ways of determining whether an asset is in use and will need to be included in a build. I'm not familiar with how ProBuilder works but with TextMeshPro there is no real way to determine if an effect will be in a future snippet of text making it necessary to include them all.
     
  7. Egil-Sandfeld

    Egil-Sandfeld

    Joined:
    Oct 8, 2012
    Posts:
    72
    Necroposting but, in my experience just now with 2019.3.15, disabling built-in packages does unfortunately not decrease build size. It would have been awesome for the chunky libunity.so file to shrink...



    Before 34.8mb Android build:


    After 34.8mb, essentially nothing changed:
     
    ZO5KmUG6R, Ryiah, Xriuk and 9 others like this.
Thread Status:
Not open for further replies.