AR Foundation/ARKit is killing UnityWebRequests
Hi,
So this is one of the weirder bugs I have ever encountered. We have developed an app that loads in lots of assetbundles on the fly by using the UnityWebRequest Post & Get. But for some reason, from time to time in using our application the UnityWebRequests freezes and will never stop yielding (even while the timeout value has long passed). It will forever freeze, even after Disposing the current UnityWebRequest and starting it up again (progess will be 0 forever). (it doen'st matter which url you place in the webrequests, google.com or our own servers, the behaviour is the same). This behavious has only been seen in iOS, not in the editor.
I have been bashing my head on this issue for over a few weeks now, debugging endlessly. Today I decided to try something new and create a clean project to stresstest the UnityWebrequest. Obviously the Webrequests worked perfect.
Than I added AR Foundation, ARKit packages and the AR Foundation Samples to the project, modified the SimpleAR sample scene to include my Webrequest demo and guess what, after scanning the room, creating some planes, placing my hand over the camera to give ARkit a hard time etc, ALL the webrequests freeze.
I've been using Unity 2019.4.18f1 but can easily reproduce this on 2019.4.1f1. I can not go back to an older version of AR Foundation than 4.1.0 because older versions had another app breaking bug. The bug is reproducable on all iOS devices I have (iPhone X, iPhone XS, iPad Pro Gen 2, iPad Pro Gen 4).
However it will take some effect to reproduce the error, you really have to scan some different surfaces, block the camera and things like that.
I've attached the test project. Simply build the SimpleAR scene to iOS, in that scene you see a textfield with "Succes: 0 Failed: 0", Success will keep counting up for every "non freezing webrequest", and after while, while you are scanning the surroundings and blocking the camera view the Failed will only keep increasing.
Example project: http://www.alteregogames.com/AlteregoGames/Webrequest%20Test.rar
Video (skip to 1:14 to see the issue happen): http://www.alteregogames.com/AlteregoGames/RPReplay_Final1611928112.mp4
Please see https://github.com/Unity-Technologies/arfoundation-samples/issues/694#issuecomment-760437908
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.