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

UnityWebRequests on iOS sometimes get stuck indefinitely even with timeout set

Discussion in 'Scripting' started by nilsdr, Nov 26, 2020.

  1. Midnight-Walker

    Midnight-Walker

    Joined:
    Mar 6, 2015
    Posts:
    3
    No building as a Development build does not make the issue go away.
     
  2. fraeri

    fraeri

    Joined:
    Nov 8, 2018
    Posts:
    64
    Just stumbled across this thread, because we seem to have the same problem with randomly freezing iOS Build most likely because of UWR. We saw this issue because we switched from http to https web adress. And we are Using 2019.4.18.

    So is everyone now upgrading to 2019.4.21 or still using the "webOperationQueue.qualityOfService = NSQualityOfServiceUserInteractive"-Hack?

    Thanks a lot


    Oh yeah, just FYI: no ARFoundation in our project though ,...
     
  3. re-cheid

    re-cheid

    Joined:
    Apr 10, 2017
    Posts:
    34
    We upgraded and the problem never occured again on our side
     
  4. fraeri

    fraeri

    Joined:
    Nov 8, 2018
    Posts:
    64
    Oh okay nice!

    Is there any resource where I can find in which Unity-Version this problem disappears?
     
  5. roc0102

    roc0102

    Joined:
    Feb 12, 2020
    Posts:
    2
  6. re-cheid

    re-cheid

    Joined:
    Apr 10, 2017
    Posts:
    34
    https://unity3d.com/unity/whats-new/2019.4.21

    • iOS: Fixed UnityWebRequest sometimes getting stuck on iOS 14.2+ when using ARFoundation. (1299873)
     
    fraeri likes this.
  7. cdrakep

    cdrakep

    Joined:
    Mar 7, 2017
    Posts:
    6
  8. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    62
    I have same problem with UnityWebRequest in iOS device in 2021.2.3f1 M1 Silicon. Xcode shows: "Error while Receiving: HTTP/1.1 422 Unprocessable Entity". I'm using ARFoundation and iOS 14.4.2. How can I fix it?
     
  9. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,637
    The description does not sound like the same problem, it sounds like request has failed with HTTP error 422.
    Or does request get stuck for you and this error is only visible in XCode console?
     
  10. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    62
    My code is:

    Code (CSharp):
    1. UnityWebRequest www1 = UnityWebRequestTexture.GetTexture(url);
    2.             yield return www1.SendWebRequest();
    3.  
    4.             while (!www1.isDone)
    5.             {
    6.                 Debug.LogError("cargando mapa...");
    7.  
    8.                 yield return null;
    9.             }
    10.  
    11.             if (www1.isNetworkError || www1.isHttpError)
    12.             {
    13.                 Debug.Log("Error while Receiving: " + www1.error);
    14.                 Instantiate(Resources.Load("_Canvas_MENSAJECONEXION"), transform.position, transform.rotation);
    15.              }
    16.             else
    17.             {
    18.                 yield return new WaitForSeconds(0.5f);
    19.                 maprender.material.mainTexture = ((DownloadHandlerTexture)www1.downloadHandler).texture;
    20.             }
    In Unity editor the textures are loaded fine with no errors in the console but in iOS device don't appear the textures. When I debug with Xcode it shows Error while Receiving: HTTP/1.1 422 Unprocessable Entity when textures aren't showed, but the game plays ok. Only textures aren't loaded.

    In my old Intel MacBook and Unity 2019.4.25f1 works fine and iOS device shows the textures.
     
    Last edited: Nov 30, 2021
  11. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,637
    So it's definitely a completely different error then this thread is about.
    And I'm lost now. Is it M1 error or iOS or iOS app on M1?
     
  12. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    62
    It's an error that appears when runs the app in iOS device that is build in a MacBook Pro M1 with Unity 2021.2.3f1
     
    Last edited: Nov 30, 2021
  13. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,637
    Does it happen on iOS device or does it happen specifically when build from M1? That is, if older x86 Mac is used, does the app on iOS device run correctly?
     
  14. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    62
    Yes, It happens when build from M1 in iOS device. When build from older x86 Mac in iOS device the app run correctly
     
  15. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,637
    Could you report a bug for this using Unity Editor?
    Thanks.