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. Dismiss Notice

UnityWebRequest on Android at an IPV6 address fails

Discussion in 'Multiplayer' started by DovitItalia, Mar 29, 2022.

  1. DovitItalia

    DovitItalia

    Joined:
    Mar 23, 2020
    Posts:
    50
    Hello,

    I'm trying to retrive some text form a hosted resource online. by doing that i want to use the hoster IPV6 as address. It works on editor but not on android (tested on android 6, 9 and 11)

    I then did a generic test:

    Code (CSharp):
    1. IEnumerator Start()
    2.     {
    3.         string req = "http://[::ffff:801e:3464]/TR/PNG/iso_8859-1.txt";//  that is equivalent of: https://www.w3.org/TR/PNG/iso_8859-1.txt ,and works perfectly on editor
    4.  
    5.         var request = UnityWebRequest.Get(req);
    6.  
    7.        yield return request.SendWebRequest();
    8.  
    9.         if (request.result == UnityWebRequest.Result.ConnectionError ||
    10.             request.result == UnityWebRequest.Result.ProtocolError)
    11.         {
    12.             GetComponent<TextMeshProUGUI>().text = "Error on getting file!\n\n" + request.error;
    13.         }
    14.         else
    15.         {
    16.             GetComponent<TextMeshProUGUI>().text = request.downloadHandler.text;
    17.         }
    18.     }
    and it seems I cannot make a simple unitywebrequest on android, the answer is always "Cannot resolve destination host".

    Where am I wrong?
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,637
    There is a known issue with IPv6 support on Android. Fix is in the works.
     
  3. HotYearKit

    HotYearKit

    Joined:
    Dec 4, 2018
    Posts:
    9
    you maybe need use https://
     
  4. DovitItalia

    DovitItalia

    Joined:
    Mar 23, 2020
    Posts:
    50
    @LINYAN999 http or https in this case doesn't matter, same result

    @Aurimas-Cernius thx for the answer, is there a workaround about it in the meantime? Or do you know when approximately will be fixed? IPV6 is becoming more and more a thing and our app works alot with the network