Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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:
    17
    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:
    80
    is the permission right on the server and can you acces yourshelf the file?
     
  3. davidborbis

    davidborbis

    Joined:
    May 2, 2019
    Posts:
    17
    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:
    17
    Darn, that didn't work. The error is literally "Unknown Error"
     
  5. davidborbis

    davidborbis

    Joined:
    May 2, 2019
    Posts:
    17
    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
     
unityunity