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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

UnityWebRequest not working for oculus quest

Discussion in 'VR' started by davidborbis, Feb 17, 2020.

  1. davidborbis

    davidborbis

    Joined:
    May 2, 2019
    Posts:
    26
    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.


    Code (CSharp):
    1.  UnityWebRequest www = UnityWebRequest.Get("http://theWebsite.com/form.json");
    2.             yield return www.SendWebRequest();
    3.  
    4.             if (www.isNetworkError || www.isHttpError)
    5.             {
    6.                 Debug.Log("error");
    7.                 Debug.Log(www.error);
    8.                 if (isServer)
    9.                     internetError.SetActive(true);
    10.             }
    11.             else
    12.             {
    13.  
    14.                 questionInfo = QuestionInfo.CreateFromJSON(www.downloadHandler.text);
    15.                
    16.                 FormSetup(questionInfo);
    17.             }
    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
     
  2. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    is the permission right on the server and can you acces yourshelf the file?
     
  3. davidborbis

    davidborbis

    Joined:
    May 2, 2019
    Posts:
    26
    Yea, I can access it from any other device. I will try updating my oculus sdk and make a build after that
     
  4. davidborbis

    davidborbis

    Joined:
    May 2, 2019
    Posts:
    26
    Darn, that didn't work. The error is literally "Unknown Error"
     
  5. davidborbis

    davidborbis

    Joined:
    May 2, 2019
    Posts:
    26
    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
     
    Noa3 likes this.
  6. charlymoncayo

    charlymoncayo

    Joined:
    Feb 8, 2020
    Posts:
    1
    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="@StyLe/UnityThemeSelector" android:icon="@Mipmap/app_icon" android:label="@String/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
     
    SDSauron likes this.
  7. SDSauron

    SDSauron

    Joined:
    Oct 17, 2019
    Posts:
    4
    Thanks, you have saved our project :D
     
  8. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,878
    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
     
    SDSauron likes this.
  9. SDSauron

    SDSauron

    Joined:
    Oct 17, 2019
    Posts:
    4
    Yeah, it stopped working today :/, and nothing was touched :/
     
  10. SDSauron

    SDSauron

    Joined:
    Oct 17, 2019
    Posts:
    4
    Have you tried disabling "Force Remove Internet Permission" on Project Settings -> XR Plug-In Management -> Open XR -> Meta Quest Support ?
     
  11. poshaughnessey

    poshaughnessey

    Joined:
    Jul 12, 2012
    Posts:
    45
    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.