I am experiencing web request failures that only occur on the Meta Quest 2 VR headset.
The requests return successfully in the Editor, in Desktop builds and in regular non-VR Android builds.
I have created a Unity 2022 LTS project, based on the VR Template provided in Unity Hub, and configured it for the Quest.
The headset has been configured with developer mode and all requirements have been installed.
After connecting the headset through cable, build and deployments work fine and I can navigate the sample scene.
The issue occurs on any type of HTTP request I make through scripting.
I have tested with UnityWebRequest
and .NET’s HttpClient
.
UnityWebRequest
returns a "Cannot resolve destination host"
network error with "ConnectionError"
as a message result, whereas HttpClient
causes a "WebException: Error: NameResolutionFailure"
.
What I’ve tried:
- Using different destination hosts (my own Servers, Google images or public Json REST APIs)
- Using http or https
- Enabling a custom
AndroidManifest.xml
and adding"android.permission.INTERNET" and "android.permission.ACCESS_NETWORK_STATE"
to it - Ensuring the correct
Android Permissions
are requested by the app to the user prior to the web requests - Ensuring OpenXR is being used and “Meta Quest Support” is enabled
- Disabling
"Force Remove Internet Permission"
underProject Settings > XR Plug-in Management > OpenXR > Meta Quest Support
- Enabling
"Require"
underProject Settings > Player > Other Settings > Configuration > Internet Access
I have also tried deploying the app to a different Meta Quest on a different network and the issue persists.
I’ve ran out of ideas and could use some help determining what am I doing wrong.
Below I leave some links to related topics:
- https://forum.unity.com/threads/unity-removes-android-permission-internet-in-the-build-apk-after-build-is-completed.1466654/
- https://forum.unity.com/threads/webexception-error-nameresolutionfailure-only-on-android-mono-builds.365905/
- https://forum.unity.com/threads/unitywebrequest-connectionerror-in-2021-lts-but-not-2020-lts-webgl.1359248/
- https://forum.unity.com/threads/extra-permission-needed-in-android.295556/
- https://forum.unity.com/threads/unitywebrequest-dns-resolution-inconsistent.1234042/
- Android app not accessing internet... how to fix it?
- Issues with UnityWebRequest GET on Android
- UnityWebRequest not working junt in Android with unity 2018.3.x - #2 by waizui
All the mods seeing post like this:
– Patsypatt