UnityWebRequest not working for oculus quest

Hello, I am using a simple UnityWebRequest to retrieve json data for my app. It works with my hololens, ipad, and android galaxy s7, but for some reason I get an unknown error with the quest.

 UnityWebRequest www = UnityWebRequest.Get("http://theWebsite.com/form.json");
            yield return www.SendWebRequest();

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log("error");
                Debug.Log(www.error);
                if (isServer)
                    internetError.SetActive(true);
            }
            else
            {
  
                questionInfo = QuestionInfo.CreateFromJSON(www.downloadHandler.text);
               
                FormSetup(questionInfo);
            }

I just get an unknown error. I imported the oculus sdk, made sure the oculus was connected to the network. Is there a permission I need to set somewhere since it is an unknown source? Anything I could try? I am using unity 2018.3.2f1

Thanks

is the permission right on the server and can you acces yourshelf the file?

Yea, I can access it from any other device. I will try updating my oculus sdk and make a build after that

Darn, that didn’t work. The error is literally “Unknown Error”

Got it to work.

Https instead of http worked. Strange how http works for all the other devices. You can access it either way in a browser and it doesn’t redirect.

Cool beans

1 Like

Hi, I resolved this error “Unknown Error” modifying the AndroidManifest.xml

AndroidManifest is on Project Folder (C:\Users\dell\Documents\Unity Projects\ProjectName\Temp\StagingArea) in my case

copy this file in the other side and edit:

add: android:usesCleartextTraffic=“true”
in this line, like that:

<application android:theme=" @ /UnityThemeSelector" android:icon=" @Mipmap /app_icon" android:label=" @anon_76954444 /app_name" android:usesCleartextTraffic=“true”>

then add the file in your project
assets / Plugins / Android /
PD: if the folders do not exist, you must create them

1 Like

Thanks, you have saved our project :smile:

The internet permission is getting removed by unity builds for XR in latest LTS and its really irritating as it prevents apps from working. This has been mentioned by many users in the last 2 weeks, why is this still an issue? Please can somebody respond with what is going on regarding it?

Try using webrequests in a build using latest LTS and interaction toolkit that targets vive or pico for example, and see what happens. It removes the internet permission

1 Like

Yeah, it stopped working today :/, and nothing was touched :confused:

Have you tried disabling “Force Remove Internet Permission” on Project Settings → XR Plug-In Management → Open XR → Meta Quest Support ?

1 Like

We are also seeing this issue. We untick “forceRemoveInternetPermission”, but it keeps getting automatically reset back to true. Every time we do a local build, all web requests fail.

1 Like

Hey guys, I’ve been having the same problem and unticking “forceRemoveInternetPermission” did work for me! TJust make sure that when doing the build it didn’t reset back to true (don’t now why it does that).

It’s worth mentioning that you also need these 2 lines on your manifest:

Using Unity 2022.3.11f