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

Caching.CleanCache returns false and fails

Discussion in 'Editor & General Support' started by Anemor2000, Feb 15, 2016.

  1. Anemor2000

    Anemor2000

    Joined:
    Jun 12, 2015
    Posts:
    39
    Hi, I have this debug button in my app that I use to unload all the asset bundles I have loaded.
    One line :
    Caching.CleanCache();
    that's all.
    Very useful. Today, for some reason, it will no longer work. It won't work in Unity Editor and it won't work on my android build. It returns false which would mean it's in use. That's all the doc says, Cache is never cleaned.

    Any hints would be really appreciated, thanks!

    joseph
     
  2. Anemor2000

    Anemor2000

    Joined:
    Jun 12, 2015
    Posts:
    39
    Is there any reason at all why the Cache would be busy?
     
  3. Anemor2000

    Anemor2000

    Joined:
    Jun 12, 2015
    Posts:
    39
  4. Anemor2000

    Anemor2000

    Joined:
    Jun 12, 2015
    Posts:
    39
    Bump again
     
  5. seec1

    seec1

    Joined:
    Jun 6, 2016
    Posts:
    11
    Hello,
    This is a trick.
    You must set a FAKE CRC parameter in GetAssetBundle or www.LoadFromCacheOrDownload
    Ex:
    UnityWebRequest www = UnityWebRequest.GetAssetBundle(url, (uint)version, 1111111);
    With this fake crc unity will delete this asset, and you can download again without exit game.
    Hope to help.