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

UnityWebRequest current status and iOS problems

Discussion in 'iOS and tvOS' started by Miguel-Ferreira, Jan 19, 2016.

  1. Miguel-Ferreira

    Miguel-Ferreira

    Joined:
    May 8, 2015
    Posts:
    90
    Hi,

    Unity's new experimental UnityWebRequest seems awesome (providing me with the only option so far to decompress a png on a background thread) but it seems somewhat unstable.

    I keep getting strange error logs like m_ReferenceCount == 0 on both the editor and on iOS and it simply crashes on UnityWebRequest finalizer on iOS.

    Is there any way around these problems? Will the final version of UnityWebRequest be released in 5.3 branch? Is there any ETA? I can't find anything on the roadmap.

    As it currently stands it's super useful but unstable.
     
    berg44 likes this.
  2. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    If you are having troubles with UnityWebRequest please submit bug reports.
    It greatly improves our chances to fix these issues.
    Thanks!
     
  3. Miguel-Ferreira

    Miguel-Ferreira

    Joined:
    May 8, 2015
    Posts:
    90
    Filed bug 763234 for the Editor/iOS common console.log problems
    Filed bug 763240 for the mono scripting backend ios problem.

    I still can't pin down the finalizer crash on a sample project. I'll go back to my main project and see if it happens again
     
  4. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Thanks! I forwarded your cases to QA.
     
  5. Younghwan-kim

    Younghwan-kim

    Joined:
    Apr 2, 2013
    Posts:
    4
    I have same problem. I use unity 5.3.3f1.
    Is fixed?
     
  6. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    According to our bugtracker it was fixed in 5.3.4.
     
  7. Miguel-Ferreira

    Miguel-Ferreira

    Joined:
    May 8, 2015
    Posts:
    90
  8. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    Nonetheless, I have not yet received any updates on very specific issues described more than three months ago, here. Simply put, some parts of the API are not working as intended.

    @Mantas Puida would you help passing cases 751794 and 751798 to someone who can review those? Justinas was going to look into them, but I got no news or feedback ever since.
     
    Last edited: Mar 26, 2016
  9. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Hi, the bug has been fixed internally. We don't know yet which release the fix will land into.
     
  10. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    @povilas Thanks for your comment. You speak of "the" bug, which persists the mistery regarding the two (or three) reported issues. Can you elaborate in any way?
     
  11. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Is it recommended we start using UnityWebRequest in place of WWW?
     
  12. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    The situation is very uncomfortable for developers trying to use the UnityWebRequest API: bugs, horrible communication, months in the dark regarding progress, Unity staff ignoring the issue tracker and bug reports...

    At least in my case, I won't start using UnityWebRequest (I tried and can't, due to bugs), and I discourage others to do so. I only hope the situation improves before they deprecate the WWW class.
     
    Last edited: Apr 9, 2016
  13. Miguel-Ferreira

    Miguel-Ferreira

    Joined:
    May 8, 2015
    Posts:
    90
  14. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    Not really. Although I had hopes for it, reading the changelog could not found transcendental improvements on the UnityWebRequest API, other than it was promoted from "Experimental" (which actually happened back in november, while Unity was still working on 5.4b).

    Five months I have been following the evolution of this API -the web calls are quite important on my projects-, but has been a harsh relation so far.
     
    Last edited: Apr 11, 2016
  15. Nimred

    Nimred

    Joined:
    Nov 1, 2014
    Posts:
    46
    I have to agree with this, from the point of view of a complete beginner in http requests. Today I set out to make Get/Post requests work for the first time in Unity. I tried UnityWebRequest first, followed the manual to the letter, but I ran into problems with the simplest possible Post request. I tried to make it work for at least an hour; The same Post request made with WWW worked within 5 minutes...
     
  16. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Could you please share some snippet of code that wasn't working with UnityWebRequest, but worked with WWW?
     
  17. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    @Mantas Puida do you have any details about cases 751794 and 751798? @povilas here commented "it" was fixed, what makes me wonder which one is, and what happens with the other?

    Also any info regarding why developers are not using the bug tracker to give any feedback?
     
  18. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    751798 was resolved as duplicate for 751794. (If these two are actually separate issues please let me know).
    751794 was fixed on trunk and was scheduled to be backported to 5.4, but it got stuck on the way. We are looking into it.
     
  19. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    @Mantas Puida thanks for the answer.

    Those are two separate issues.

    751794 is about the redirectLimit not working.

    751798 is unrelated, and indeed a separate issue. Is about redirections, but yet another problem: redirections are not checking the response header to check the next hop method. At least UnityWebRequest.Post() asumes redirections -if any- will keep using the POST method, when it may not be the case. In my concrete case, Im poking Google services using POST, but the second hop in the redirection for the 302 expects a GET request. In the bug tracker I have included a testbed webservice in Google infraestructure to help you guys see it on the field.
     
    Last edited: Apr 15, 2016
  20. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    I just got confirmation that fixes for 751794 were merged to 5.3 and 5.4 branches and should reach patch releases next week.
    This one is still being investigated. Bugreport will be re-opened.
     
  21. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    @Mantas Puida Much appreciated information, thank you very much!

    Please keep us posted regarding 751798. Also worth noting for this issue, is that the POST method works correctly on the WWW class, so is a case of a feature working on the previous API, but not in the new UnityWebRequest API).
     
  22. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    @Mantas Puida With todays Patch Release (5.3.4p5) looks like both 751798 and 751794 have been fixed. I have been able to test 751798 and is indeed fixed and working. I have not tested yet the redirectLimit issue (751794).

    Any ideas about the plans for this fixes (timeline for inclusion in Beta 5.4 and/or next official point release)?

    Thank you man, you have been really helpful here!


    Edit: tested 751794, and the redirectLimit parameter is also working as expected.
     
    Last edited: Apr 29, 2016
  23. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    878
    Bug #792606 is a hard EXC_BAD_ACCESS any time you upload data with UnityWebRequest on iOS devices (e.g. POST or PUT). That bug report has a very simple repro project attached with 100% repro rate.

    It's a crash in the destructor of the Unity C++ class "WebRequestProto" that happens when finalizers run.

    I'm trying to find a workaround right now - experimenting with things like setting "disposeUploadHandlerOnDispose" to false and disposing it myself, etc. But no joy so far - always that same crash on iOS devices.

    You really can't ship with this issue on iOS unless you are 100% GET requests.

    This repro project is using 5.3.4p5.
     
    Aizee421 and Novack like this.
  24. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
  25. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    878
    Yes, but the great folks at UT have fixed it and it will be in a patch release very soon.
     
    Novack likes this.
  26. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    Thanks man, are you following this issue in some other forum thread? Would you point me to it?

    Edit: the report on the issue tracker has been updated, and now reflects the status mentioned here (Fixed in Unity 5.3.5).

    Thanks @Mantas Puida!
     
    Last edited: May 12, 2016
  27. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    Hey @Mantas Puida it seems that there is yet another issue related to UnityWebRequest and iOS: POST requests do not always work (even when the same request works fine in other platforms).

    I have raised the Case 814388, with an encapsulated, ready-to-test script example of the issue.

    Would you help pointing this to the right people?
    Much appreciated.
     
  28. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    838
    Also, found another issue (Case 814458) where UnityWebRequest fails to create a POST request with the dictionary<string, string> method, if the payload surpasses 24Kb.

    Special Note: To bypass this issue, Im now using WWWForm: the docs mention about this class being "legacy". Can someone offer clarification regarding if this helper class will be deprecated at some point (was designed for the WWW class which is being deprecated) or will be left in there?

    Edit: Oh and found some mistakes on the documentation of the UnityWebRequest class (Case 814110).
     
  29. berg44

    berg44

    Joined:
    Apr 9, 2016
    Posts:
    3