Search Unity

Caching.ClearCache not actually deleting any old bundles

Discussion in 'Addressables' started by CodeBombQuinn, Oct 16, 2019.

  1. CodeBombQuinn

    CodeBombQuinn

    Joined:
    Apr 17, 2018
    Posts:
    23
    I'm simply trying to remove all the old bundles from the device and can't see to do it. I've made sure that there are zero bundles loaded before calling Caching.ClearCache and still not working.

    I even tried using Cache.ClearOtherCachedVersions and had this remove anything except the new one I was downloading (with a custom asset bundle provider) and still didn't work.
    https://docs.unity3d.com/ScriptReference/Caching.ClearOtherCachedVersions.html

    Now my game is bloating by 200MBs every time there's an update since the old bundles are still on device.

    How do I remove old bundles from device?

    Edit: I'm currently on Addressables 1.1.7, will try updating to latest (1.2.4 as of writing) to see if that fixes this. But no changelog items mention this so not holding out any hope of a fix.
     
  2. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    Hey @CodeBombQuinn just a couple questions, 1) what's the result of Caching.ClearCache() ? It returns a bool to indicate if it thinks it was able to clear the cache or not. 2) How are you checking that no bundles are loaded before clearing the cache? Are you using AssetBundle.GetAllLoadedAssetBundles to check or something else? 3) What device are you testing on?