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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

5.2 WWW and Caching.ready seem not to work correctly anymore

Discussion in 'iOS and tvOS' started by pahe, Sep 14, 2015.

  1. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    541
    Hi guys.

    I've updated my project to 5.2 and now my project isn't downloading my assetbundles on iOS anymore (though it works in the editor fine).

    I'm downloading the assetbundles with the following code:

    Code (CSharp):
    1.         var aLocalAssetWWW = new WWW(StreamingAssetPath + anAssetName);
    2.    
    3.         //Wait for the WWW to be initialized
    4.         Debug.Log("loading from disk");
    5.         yield return aLocalAssetWWW;
    6.         //yield return StartCoroutine(new WWWRequest(aLocalAssetWWW));
    7.  
    8.         Debug.Log("local loading done?");
    9.         while (!aLocalAssetWWW.isDone && string.IsNullOrEmpty(aLocalAssetWWW.error))
    10.         {
    11.             Debug.Log("local loading done? no");
    12.             Debug.Log("has an error: " + aLocalAssetWWW.error + " url: " + aLocalAssetWWW.url);
    13.             yield return aLocalAssetWWW;
    14.             //yield return StartCoroutine(new WWWRequest(aLocalAssetWWW));
    15.         }
    16.  
    17.         Debug.Log("caching ready? " + Caching.ready);
    18.         while (!Caching.ready)
    19.             yield return null;
    20.  
    I've found out that the yield return aLocalAssetWWW is hanging and don't get any further on iOS. For that I found a workaround here in the forum. Sadly the next problem occurs with the Caching.ready which is always returning false now.

    This code works fine on 5.1.2 (not working on 5.1.3 anymore), I've tested that there now, so something has changed there that this code is not working. Has someone else this problem?

    Any help is appreciated!
     
  2. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    541
    So, I can confirm that there is definitely a problem on iOS with the WWW class.

    Created a test project and it doesn't finish the WWW if it is targeting a non existing file.

    Case: 727455
     
  3. mholub

    mholub

    Joined:
    Oct 3, 2012
    Posts:
    123
    I have same issue with Caching.ready always false on Android on 5.2.2f1.