Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug "Server failed to bind" for host on Meta Quest 3 | Unity Transport, Netcode

Discussion in 'Unity Transport' started by MiPa258, Oct 22, 2023.

  1. MiPa258

    MiPa258

    Joined:
    Dec 14, 2022
    Posts:
    3
    Issue Description:

    Error:

    Server failed to bind. This is usually caused by another process being bound to the same port. Unity.Netcode.Transports.UTP.UnityTransport:ServerBindAndListen(NetworkEndPoint)
    Unity.Netcode.Transports.UTP.UnityTransport:StartServer()
    Unity.Netcode.NetworkManger:StartHost()
    UnityEngine.XR.Interaction.Toolkit.UI.XRUIInputModuleDoProcess()

    [Netcode] Host is shutting down due to network transport start failure of UIUnityTransport!
    Unity.Netcode.NetworkConnectionManager:TransportFailure EventHandler(Boolean)
    Unity.Netcode.NetworkManger:StartHosrt()
    UnityEngine.XR.Interaction.Toolkit.UI.XRUIInputModuleDoProcess()

    Environment:

    • Unity Versions: 2022.3.5, 2022.3.11
    • Device: Meta Quest 3
    • Networking Package: "com.unity.netcode.gameobjects": "1.5.2"
    Problem: When deploying a project to my Meta Quest 3 device, I encounter a "Server can't bind" error, preventing me from establishing a networked session.

    Steps to Reproduce:

    1. Create a new Unity project with Unity versions 2022.3.5 or 2022.3.11.
    2. Install "com.unity.netcode.gameobjects" package version 1.5.2.
    3. Setup openxr
    4. Setup netcode for gameobjects
    5. Build and deploy to Meta Quest 3.
    6. Observe the "Server can't bind" error upon attempting to start/host a server.
    Expected Behavior: The server should bind successfully, allowing for the creation of a networked session.

    Actual Behavior: The application fails to bind the server, resulting in a "Server can't bind" error message.
     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    416
    Already answered on your other thread, but this is likely due to the application lacking the
    INTERNET
    permission in its Android manifest.
     
  3. dhiegolucio

    dhiegolucio

    Joined:
    Mar 2, 2016
    Posts:
    5
    Hi Simon, I added the internet permission at my android manifest (@ plugin/android/AndroidManifest.xml) and I set build to custom manifest.
    which is basically this:

    <?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" />
    <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>

    And still have this same issue :/
     
  4. dhiegolucio

    dhiegolucio

    Joined:
    Mar 2, 2016
    Posts:
    5
    Ok, I found what was the problem:
    At Project Settings > OpenXR > Meta quest support (click at the cog)
    Uncheck the option "Force Remove Internet Permission"
    upload_2024-2-17_14-19-14.png