1

Recently I have converted my Unity 2019.1.0 project into Unity 2019.2.9 and it is a WebGL project. In the project I am using asset bundle and here is the snippet to load the bundle:

 IEnumerator DependancyAssetBundleLoader()
    {

        www = UnityWebRequestAssetBundle.GetAssetBundle(bundleURLForDependency);
       // www.chunkedTransfer = false;

        yield return www.SendWebRequest();
        AssetBundle bundleDependancy = ((DownloadHandlerAssetBundle)www.downloadHandler).assetBundle;

        if (www.error != null)
        {

            //Debug.LogError("assetBundleURL : " + bundleURLForDependency);
            Debug.LogError("response code : " + www.responseCode);

            Debug.LogError("www error : " + www.error);
            www.Dispose();
            www = null;
            yield break;

        }
    }

I don't know what went wrong with the asset bundle loading and now I am getting this error:

Received no data in response

I logged the response code and it is 0.

Muhammad Faizan Khan
  • 10,013
  • 18
  • 97
  • 186
  • In general you should check for errors before doing `AssetBundle bundleDependancy = ...`. Also use `using(var www = ...){ ... }` and so you don't have to call `Dispose` "manually". Is the URL you pass in correct? – derHugo Nov 18 '19 at 06:14
  • Yes it is correct url. I can download asset bundle from the browser using the url. It is happening after conversion to unity 2018.2.9 – Muhammad Faizan Khan Nov 18 '19 at 09:19

0 Answers0