I’m getting this error when using WWW.LoadFromCacheOrDownload: on Android
Exception: WWW download:Unknown Error
This is the code:
// Download an AssetBundle
public static IEnumerator downloadAssetBundle(string url, int version)
{
Debug.Log("We are now going to download... " + url);
Global.Instance.downloadPercentage = 0f;
AssetBundleProgressBar.Instance.Begin();
string keyName = url + version.ToString();
if (dictAssetBundleRefs.ContainsKey(keyName))
yield return null;
else
{
while (!Caching.ready)
yield return null;
Debug.Log(url);
using (WWW www = WWW.LoadFromCacheOrDownload(url, version))
{
// Added code for progress bar
while (!www.isDone)
{
Global.Instance.downloadPercentage = Mathf.Clamp01(www.progress / 0.9f);
// Debug.Log(www.progress);
yield return null;
}
AssetBundleProgressBar.Instance.End();
yield return www;
if (www.error != null)
throw new Exception("WWW download:" + www.error);
AssetBundleRef abRef = new AssetBundleRef(url, version);
abRef.assetBundle = www.assetBundle;
dictAssetBundleRefs.Add(keyName, abRef);
}
}
}
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,