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 Growing build file size each time after clearing build cache

Discussion in 'Addressables' started by Bumpalump, Jul 12, 2023.

  1. Bumpalump

    Bumpalump

    Joined:
    Dec 26, 2020
    Posts:
    13
    So it looks like for some very strange reason each time when I clear the build cache my build size gets bigger and bigger. I've checked and each time I clear cache file under "\Library\com.unity.addressables\aa" gets properly deleted and each time a file of the same size (roughly but expectantly to changes made) gets created. Problem is... here is how it goes:
    1. I add 1mb texture to adressable group, clear Addressable Cache and make a new build. File generated in "\Library\com.unity.addressables\aa" gets larger by 1MB to a total of 100MB (or something similar - anyway expectantly to added files).
    2. I make a new build. Whole build is larger by 100MB and is now in total of 600MB
    3 I add another 1mb texture to adressable group.File generated in "\Library\com.unity.addressables\aa" gets larger by 1mb to a total of 101MB.
    4. I make a new build. Whole build is larger by 100MB and in total of 701MB

    Mind you I tested it and did absolutely nothing more than building Addressables group anew and each time even without modifying the contents in the end build size bumps by 100MB and it continues to grow each time I clear Addressables cache.
    It looks like somehow somewhere each time I make a new build older generation of addressables groups gets cached and added to total build. I have no idea how cause I see how file under "\Library\com.unity.addressables\aa" gets deleted and new one is generated each time.

    Has anyone encountered similar problem with Addressables? Where those old Addressable group build copies could be stored that making actual build includes 5-6 generations of Addresssable groups? I checked the sized and they match - each new build is larger exactly by previous Addressable group build so I assume there's a copy of it cached somewhere else than "\Library\com.unity.addressables\aa" or else it wouldn't be possible right?

    Has anyone encountered something similar and maybe could offer some guidance how to fix it?

    Happens with Unity 2022.2.13 and Addressables 1.21.14
     
  2. Warmacha

    Warmacha

    Joined:
    Dec 13, 2015
    Posts:
    27
    Currently on Addressables 1.21.12, Unity 2021.3.26f1 and we are having a similar issue, however we aren't sure if it's to do with clearing the cache.
    upload_2023-7-13_18-1-15.png

    This is the size of the addressable build in the library, along with a single .bundle where it should be.

    upload_2023-7-13_18-2-13.png
    However, when building the APK, it swells into gigabytes big, adding many duplicates of the same bundle causing the build to be huge.

    No idea why at the moment.
     

    Attached Files:

  3. Warmacha

    Warmacha

    Joined:
    Dec 13, 2015
    Posts:
    27
    After more experimenting, It seems that when addressable bundles are modified between builds it makes duplicates, causing the builds to increase in size. the only way to temporarily resolve it is to delete the Bee folder in the library. I have no idea why that could be the case other than maybe some il2cpp caching the info.



    Here's what the inside of our aa folder looked like in the APK I built after nuking addressables in the project apart from the package itself. Even though I had NOTHING in the addressables and no addressable build, it still inserted all of this in there.

    Again, resolved after deleting bee folder in the library. Just going to have to do that it seems after every major addressable group change.
     
  4. sameng

    sameng

    Joined:
    Oct 1, 2014
    Posts:
    172
    Wow, yeah, my build has also been ballooning. Thanks for the temporary fix.
    Please Addressable Devs, see if this issue can be fixed?
    Anyone know if it's safe to delete the Bee folder via c# script right before building? What else is the Bee folder holding? I'm assuming it's caching stuff?