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

Error: Cannot resolve destination host (Error only in VR build but works good in Debug mode)

Discussion in 'Getting Started' started by parthasai88, Oct 11, 2023.

  1. parthasai88

    parthasai88

    Joined:
    Oct 11, 2023
    Posts:
    1
    In the process of solving this issue I tried the steps given below
    1.)
    upload_2023-10-10_21-19-14.png

    2.)
    Updated the AndroidManifest.xml as below

    <?xml version="1.0" encoding="utf-8"?>
    <manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.unity3d.player"
    xmlns:tools="http://schemas.android.com/tools">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <application>
    <activity android:name="com.unity3d.player.UnityPlayerActivity"
    android:theme="@StyLe/UnityThemeSelector">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
    </application>
    </manifest>

    3.) code REST API call

    public static IEnumerator GetRequest(string uri)
    {
    using (UnityWebRequest webRequest = new UnityWebRequest(uri, "GET"))
    {
    webRequest.downloadHandler = new DownloadHandlerBuffer();

    // Send the request and wait for a response
    yield return webRequest.SendWebRequest();

    if (webRequest.result == UnityWebRequest.Result.ConnectionError)
    {
    // Log any errors
    Debug.Log(": Error: " + webRequest.error);
    }
    else
    {
    // Log the response
    Debug.Log(": Received: " + webRequest.downloadHandler.text);
    }
    }

    }

    called GetRequest("https://www.google.com/")



    ran the build and tested on VR pro but not working as expected.
    Please help me with this Thank you