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

Old local addressable assets being included in player even when those assets no longer exist

Discussion in 'Addressables' started by Kamand0l, Jul 8, 2021.

  1. Kamand0l

    Kamand0l

    Joined:
    May 19, 2014
    Posts:
    24
    Hi !

    In version 1.18.9 there's the following change:
    • Reduced the number of file copies required during building Addressables and moving Addressables content during Player build.
    There's a problem in this part of the code:

    https://github.com/needle-mirror/co...daa7ac2e4590c982d03233a436b5e054841b1cL34-L37

    Now when building local addressables, they will remain in the Library after the build is complete(something that did not happen before this version). Because of this new behaviour, future builds will also include this content even if it does not exist anymore or said addressables were made remote unless we somehow clean this Library cache before building or remove the Library altogether.

    I think this is a major breaking change with unexpected consequences for anyone(bigger player builds) that at least should be documented.

    Cheers
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,444
    I was looking into the issue, but I'm unable to reproduce it. I tested Unity 2019.4.20f1 with Addressables 1.18.9 and 1.18.11, building a Windows Standalone Player.

    Here is how I tried to reproduce it:
    1. Create 3 AssetGroup entries Bundle1, Bundle2 and Bundle3 in Addressables Groups window
    2. Build Addressables content (Addressables Groups > Build > New Build > Default Build Script)
    3. Build Windows Standalone Player
    4. The Player directory now contains Bundle1, Bundle2 and Bundle3
    5. Delete Player build directory
    6. Remove Bundle3 AssetGroup entry from Addressables Groups window
    7. Build Addressables content (Addressables Groups > Build > New Build > Default Build Script)
    8. Build Windows Standalone Player
    After building the Player, the generated build only contains Bundle1 and Bundle2, but not Bundle3 anymore.

    How do you reproduce the problem that future builds also include content that does not exist anymore?
     
  3. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    I saw the same thing today. I deleted most of the art content in the project, then built Addressables without cleaning the cache first. The build was still the same size as before deleting almost all content. After cleaning the entire build cache it seemed to work.
     
  4. Kamand0l

    Kamand0l

    Joined:
    May 19, 2014
    Posts:
    24
    So, after a more throughout investigation I've found the real issue to my problem. I'm not sure though if the aforementioned change in the code made the underlying issue appear.

    The thing is, in my case the unexpected included assets problem was only happening in Android builds, not iOS ones.

    So, apparently, we're experiencing some nasty cache thing going on with gradle builds that will reuse resources from previous builds, meaning it includes resources from StreamingAssets from a previous build when those assets no longer exist.

    I guess we'll have to look into our gradle templates for that.

    Sorry for the inconveniences, and many many thanks for looking into this in the first place.