Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Issue connecting to the Internet from UWP

Discussion in 'Windows Mixed Reality' started by joshwhinkle, Mar 29, 2018.

  1. joshwhinkle

    joshwhinkle

    Joined:
    Mar 29, 2018
    Posts:
    1
    Hi. I'm a developer making Virtual Reality programs with Unity. I've been having some issues connecting to an online database when building for UWP so it can work with Windows Mixed Reality. Basically, what I'm trying to do is pull questions from an online JSON database which will the user will answer. However, with UWP we have issues pulling questions from the server. No other format, be it Oculus or OpenVR (which is compatible with WMR) has this issue. Does UWP have a certain issue with connecting to the Internet or interpreting JSON files?
     
  2. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    556
    Have you enabled the internet servers in the publishing settings?
     
  3. jsoncpp

    jsoncpp

    Joined:
    Mar 9, 2018
    Posts:
    6
    Any updates on this? I'm having kind of a related problem where I'm getting some text from a server using UnityWebRequest. It works properly in Unity, however when running the program on HoloLens, it won't connect.
     
    Liut2018 likes this.
  4. ivan20071

    ivan20071

    Joined:
    Nov 15, 2017
    Posts:
    29
    Hi,
    with Unity 2017.3.1p1 I use UnityWebRequest setting chunkedTransfer to false and checking only the error property.
    Doing so It works even in Release build, otherwise it works only in debug buid.
     
    jsoncpp likes this.
  5. jsoncpp

    jsoncpp

    Joined:
    Mar 9, 2018
    Posts:
    6
    Hey, thank you for your reply! I just tried your solution and it worked. I am curious though about why
    Code (CSharp):
    1. (isNetworkError || isHttpError)
    is triggered in release build?
     
  6. RominaM

    RominaM

    Joined:
    Jan 16, 2019
    Posts:
    2
    Hi everyone,
    are there any updates on this topic?
    Because I am using Unity version 2018.3.0f2 and I have a similar problem with UnityWebRequest that I can't get solved right now.

    My setup:
    I want to release my application for the HoloLens and use UnityWebRequest to retrieve data from a database. In Unity there is no problem compiling and I can read the data as expected. But when I release the application in debug mode in Visual Studio for the HoloLens I get the following errors:
    (isNetworkError || isHttpError) = true
    error = Unknown Error
    Response Code = 0


    What I've been trying to do so far:
    chunkedTransfer = false
    (in Unity) Edit > Project Settings > Player Settings > Capabilities
    - Internet client,
    - Internet Client Server and
    - Private Network Client Server


    I have an internet connection with the HoloLens, because if I disconnect the device I get the error message "cannot resolve destination host".

    Any help in this area is very appreciated.
     
  7. RominaM

    RominaM

    Joined:
    Jan 16, 2019
    Posts:
    2
    For anyone dealing with the same issue:
    I can release my app on the HoloLens now, since I downgraded my Unity version to 2018.1.0f2. Then I could reproduce the error message that says "cannot resolve destination host" and I noticed a strange behavior: in Unity an http request can be sent if no "/" is set after the url, but on the HoloLens it does not work without the slash.
     
  8. MrSmokes

    MrSmokes

    Joined:
    Jun 13, 2017
    Posts:
    8
    having pretty much the same problem. Unity 2018.3.7f1

    in player settings > capabilities i have:
    enterprise authentication
    internet client
    internetclientserver
    privatenetworkclientserver
    all enabled.

    tried https://server.name/filename.json - works in editor, not on hololens (was working with http:// file hosted on private network with the above settings)
    https://server.name/filename.json/ (additional / on the end) hasn't resolved the issue and now causes errors in the editor (unexpected character while parsing path)

    changing https:// to http:// works within the editor, not within the HoloLens.

    *tears hair out*
    *sets HoloLens on fire*
     
  9. MrSmokes

    MrSmokes

    Joined:
    Jun 13, 2017
    Posts:
    8
    looks like it may have been a Microsoft problem, as after a software+firmware update to my dev HoloLens, it all started working.

    so for anyone else having issues loading public files to your HoloLens, make sure you've installed the latest updates before you set it on fire.
     
  10. khaleel671

    khaleel671

    Joined:
    Mar 29, 2019
    Posts:
    1
    I am facing the same problem.

    It works totally fine in Editor but not on Hololens. I have set all the capabilities but still I get the error "Cannot connect to destination host"

    Any other solution?
     
  11. upeter

    upeter

    Joined:
    Sep 13, 2018
    Posts:
    2
    I have the same problem. Does anyone know a solution for this?
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,651
    Update your Unity version. This has been fixed in 2020.1.0a4, 2019.3.0b4, 2019.2.7f2 and 2018.4.10f1.