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

Resolved 1.0.0-exp.8: Editor 2022.2.0b8 android build crashes due to Unity.Networking.Transport error

Discussion in 'NetCode for ECS' started by Occuros, Oct 5, 2022.

  1. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    284
    After building with the Default build pipeline (not the platform build pipeline for 0.51) for Android, I get a crash right at startup.

    Now I know there are multiple issues with building dots projects currently (after each build editor crashes, selecting faster (smaller) build, etc.) but I did manage to get a linux (server) build working, while the android build does not.

    I assume it is netcode related due to the reference to Unity.Networking.Transport errors I receive.

    Is this a known issue with the current editor version (2022.2.0b8) or did I miss a specific config needed to make a netcode projects work on android?

    Any help would be appreciated.

    (Error below)
    Code (CSharp):
    1. 2022/10/05 02:32:17.516 26071 26095 Error Unity NotImplementedException: The method or operation is not implemented.
    2. 2022/10/05 02:32:17.516 26071 26095 Error Unity   at Unity.Networking.Transport.BaselibNetworkInterface.Initialize (Unity.Networking.Transport.NetworkSettings& settings, System.Int32& packetPadding) [0x00000] in <00000000000000000000000000000000>:0
    3. 2022/10/05 02:32:17.516 26071 26095 Error Unity   at Unity.Networking.Transport.NetworkInterfaceLayer`1[N].Initialize (Unity.Networking.Transport.NetworkSettings& settings, Unity.Networking.Transport.ConnectionList& connectionList, System.Int32& packetPadding) [0x00000] in <00000000000000000000000000000000>:0
    4. 2022/10/05 02:32:17.516 26071 26095 Error Unity   at Unity.Networking.Transport.NetworkStack.AddLayer[T] (T& layer, Unity.Networking.Transport.NetworkSettings& settings) [0x00000] in <00000000000000000000000000000000>:0
    5. 2022/10/05 02:32:17.516 26071 26095 Error Unity   at Unity.Networking.Transport.NetworkStack.AddLayer[T] (T layer, Unity.Networking.Transport.NetworkSettings& settings) [0x00000] in <00000000000000000000000000000000>:0
    6. 2022/10/05 02:32:17.516 26071 26095 Error Unity   at Unity.Networking.Transport.NetworkStack.CreateForSettings[N] (N& networkInterface, Unity.Networking.Transport.NetworkSettings& networkSett
    7.  
     
    aducceschi likes this.
  2. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    774
    We will investigate on this. Please file a proper case of it. Looks like a problem we want to proper track
     
    aducceschi likes this.
  3. aducceschi

    aducceschi

    Joined:
    Feb 9, 2022
    Posts:
    39
    Same problem here when building for Oculus Quest 2 (which runs on Android). But I get no error message. And I don't have Netcode or Transport installed in my project.
     
  4. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    284
    I have reported it through the bug reporting system (case number: IN-18768).

    I also have a minimal repo (it crashes without even creating a custom client-server bootstrap)

    https://github.com/Occuros/DotsNetcodeBuildErrorSample

    Hopefully, that can be investigated soon, really looking forward to testing out 1.0 on a real device.
     
  5. aducceschi

    aducceschi

    Joined:
    Feb 9, 2022
    Posts:
    39
    Unity 2022.2.0b11 has fixed the player crashing when containing a subscene in the scene. When having set the compiler to IL2CPP. I don't know however if the Unity Networking error has been fixed, but maybe it's related.
     
  6. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    774
    For this specific issue I already posted a fix you can apply in another thread:

    You need to replace in the DefaultDriverBuilder.RegisterClientDriver the call to new BaselibNetworkInterface with new UDPNetworkInterface.

    Code (csharp):
    1.  
    2.         public static void RegisterClientDriver(World world, ref NetworkDriverStore driverStore, NetDebug netDebug, NetworkSettings settings)
    3.         {
    4.             Assert.IsTrue(ClientServerBootstrap.RequestedPlayType != ClientServerBootstrap.PlayType.Server);
    5.             Assert.IsTrue(world.IsClient());
    6. #if !UNITY_CLIENT
    7.             if (UseSocketDriver(netDebug))
    8.             {
    9.                 netDebug.DebugLog("Create client default socket network interface driver");
    10.                 var driverInstance = DefaultDriverBuilder.CreateClientNetworkDriver(new UDPNetworkInterface(), settings);
    11.                 driverStore.RegisterDriver(TransportType.Socket, driverInstance);
    12.             }
    13.             else
    14.             {
    15.                 netDebug.DebugLog("Create client default IPC network interface driver");
    16.                 var driverInstance = DefaultDriverBuilder.CreateClientNetworkDriver(new IPCNetworkInterface(), settings);
    17.                 driverStore.RegisterDriver(TransportType.IPC, driverInstance);
    18.             }
    19. #else
    20.             netDebug.DebugLog("Create client default socket network interface driver");
    21.             var driverInstance = DefaultDriverBuilder.CreateClientNetworkDriver(new UDPNetworkInterface(), settings);
    22.             driverStore.RegisterDriver(TransportType.Socket, driverInstance);
    23. #endif
    24.         }
    25.  
     
    aducceschi likes this.
  7. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    284
    Thank you @CMarastoni with these changes the build doesn't crash anymore (with 2022.11b editor version).

    Not sure if I should mark this thread as resolved, as it still requires to modify the netcode package, or wait until the package is updated with the fix?
     
  8. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    774