Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice
  2. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

UnityWebRequest.GetAssetBundle Fails when a CRC first changes

Discussion in 'Editor & General Support' started by KJoanette, Jan 15, 2018.

  1. KJoanette

    KJoanette

    Joined:
    Jun 8, 2013
    Posts:
    59
    I've been trying to update my AssetBundle system to use the correct CRCs for files instead of passing 0. However, I keep getting this: Error while downloading Asset Bundle: CRC Mismatch. Provided c7e23ee8, calculated b884e9b0 from data. Will not load AssetBundle

    The CRC I'm providing is 100% correct...but it looks like Unity is calculating the CRC on the currently cached bundle and not the new one that I'm pointing to. Once this error occurs and you try again the cache has been cleared and everything works.

    This seems like a very serious bug. Has anyone else had this issue?
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,075
    If what you say is true, it is a bug.
    Can you make a repro project and submit a bug (recommendation to make sure of it one more time).
     
    KJoanette likes this.
  3. KJoanette

    KJoanette

    Joined:
    Jun 8, 2013
    Posts:
    59
    I'm wondering if this is expected behaviour? I am passing version 0 and the correct CRC. I imagine that Unity is deciding to only check the version and not the CRC in some cases? I would have thought changing either of these would cause Unity to re-cache.

    I do have a repro project to submit, but if that is expected then I guess that's just how it is. I was hoping to avoid passing the completely arbitrary version number for downloading the manifest bundle since it also doesn't have a hash value. This is something that is still really inconsistent with bundle loading (every other bundle after that can be loaded via Hash128).

    EDIT: This checks out. Bumping the version up by one avoids the cache error. However, in the case I mentioned it still resolves itself the second time through if the CRC didn't match (which I would expect to continue failing forever)
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,075
    I think this should be asked in the asset bundle forum, that a very specific question regarding caching, I'm not that much of an expert in that.
     
  5. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @KJoanette Did you ever figure this out? I'm having a similar issue.
     
  6. Isabelle02

    Isabelle02

    Joined:
    Mar 1, 2013
    Posts:
    2
    Like @Ben-BearFish I have the similar issue. Have you found a solution ?
     
  7. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @Isabelle02 Not that I can recall. We moved onto the Addressables system.
     
unityunity