Search Unity

Exception: WWW download:Unknown Error

Discussion in 'Addressables' started by roseportalgames, Nov 24, 2018.

  1. roseportalgames

    roseportalgames

    Joined:
    Aug 9, 2017
    Posts:
    173
    I'm getting this error when using WWW.LoadFromCacheOrDownload:

    Code (CSharp):
    1. Exception: WWW download:Unknown Error
    This is the code:

    Code (CSharp):
    1. // Download an AssetBundle
    2.     public static IEnumerator downloadAssetBundle(string url, int version)
    3.     {
    4.         Debug.Log("We are now going to download... " + url);
    5.         Global.Instance.downloadPercentage = 0f;
    6.         AssetBundleProgressBar.Instance.Begin();
    7.  
    8.         string keyName = url + version.ToString();
    9.         if (dictAssetBundleRefs.ContainsKey(keyName))
    10.             yield return null;
    11.         else
    12.         {
    13.             while (!Caching.ready)
    14.                 yield return null;
    15.             Debug.Log(url);
    16.             using (WWW www = WWW.LoadFromCacheOrDownload(url, version))
    17.             {
    18.                 // Added code for progress bar
    19.                 while (!www.isDone)
    20.                 {
    21.                     Global.Instance.downloadPercentage = Mathf.Clamp01(www.progress / 0.9f);
    22.                     // Debug.Log(www.progress);
    23.                     yield return null;
    24.                 }
    25.                 AssetBundleProgressBar.Instance.End();
    26.  
    27.                 yield return www;
    28.                 if (www.error != null)
    29.                     throw new Exception("WWW download:" + www.error);
    30.                 AssetBundleRef abRef = new AssetBundleRef(url, version);
    31.                 abRef.assetBundle = www.assetBundle;
    32.                 dictAssetBundleRefs.Add(keyName, abRef);
    33.             }
    34.         }
    35.     }
    It's downloading from here:

    http://www.roseportalgames.com/files/assetbundles/Android/duplicates

    I didn't have this problem before updating my game with some new content so I'm a bit confused.

    Thanks,
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053