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

Asset bundle Error : Failed to decompress data for the AssetBundle 'Memory'.

Discussion in 'Editor & General Support' started by itsharshdeep, Mar 1, 2018.

  1. itsharshdeep

    itsharshdeep

    Joined:
    Mar 7, 2014
    Posts:
    9
    Hi All,

    I am getting error while downloading the 'AssetBundleManifest'.

    I have no idea, that how to resolve that.
    ----------
    Code for the downloading the manifest:

    Code (CSharp):
    1.  
    2. void Start ()
    3.         {
    4.             assetBundleManifestCachePath = Application.persistentDataPath + System.IO.Path.DirectorySeparatorChar + assetBundleManifestCacheFileName;
    5.             StartCoroutine (GetAssetBundleList (assetBundleManifestUrl));
    6.         }
    7.  
    8.  
    9.  
    10. IEnumerator GetAssetBundleList (string path)
    11.         {
    12.             bool local;
    13.             if (path.StartsWith (localFilePrefix)) {
    14.                 local = true;
    15.                 Debug.Log ("Loading asset manifest from cache");
    16.             } else {
    17.                 local = false;
    18.                 Debug.Log ("Downloading asset manifest form internet");
    19.             }
    20.  
    21.             WWW www = new WWW (path);
    22.             yield return www;
    23.  
    24.             if (String.IsNullOrEmpty (www.error)) {
    25.                 // Only save a cache file if downloading from internet.
    26.                 if (!local) {
    27.                     System.IO.File.WriteAllBytes (assetBundleManifestCachePath, www.bytes);
    28.                 }
    29.                 AssetBundles.manifest =  (AssetBundleManifest)www.assetBundle.LoadAsset("AssetBundleManifest", typeof(AssetBundleManifest));
    30.                 yield return null;
    31.                 Debug.Log ("Finished manifest");
    32.  
    33.                 www.assetBundle.Unload (false);
    34.                 www.Dispose ();
    35.                 if (ReceivedAssetBundleManifest != null)
    36.                     ReceivedAssetBundleManifest ();
    37.             } else {
    38.                 if (local) {                    // error during loading cached file
    39.                     Debug.Log ("Couldn't find an offline version of asset manifest.");
    40.                     Debug.Log ("Please connect to internet and try again.");
    41.                 } else {                    // error during download
    42.                     Debug.Log ("!!! Error downloading manifest, looking for offline version.");
    43.                     StartCoroutine (GetAssetBundleList (localFilePrefix + assetBundleManifestCachePath));
    44.                 }
    45.             }
    46.         }
    47.  
     
  2. itsharshdeep

    itsharshdeep

    Joined:
    Mar 7, 2014
    Posts:
    9
    adamt_amlab and Sermolux like this.
  3. hannya93

    hannya93

    Joined:
    Aug 18, 2016
    Posts:
    6
    Thanks a lot, this saves me after a whole week of frustration on what happened
     
  4. NeiratAhmad

    NeiratAhmad

    Joined:
    Jun 21, 2014
    Posts:
    5
    Your 7 years old post SAVED ME ...
    After spending the day searching for a solution, I stumbled into this once, twice and three times .. and said (naah it doesn't make sense) .. then turned out I was wrong ....

    THIS IS THE SOLUTION .. THANK YOU T_T ...
     
    DragonkinStudios likes this.