Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unity Multiplayer HLAPI package build failures

Discussion in 'Connected Games' started by angusmf, Mar 10, 2019.

  1. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    255
    In case anyone runs into the same thing or even knows how to fix it, I'm posting the contents of my bug report here. I was also having trouble getting the report to submit, so put the repro case on github: https://github.com/angusmf/Test_HLAPI_Package

    1. What happened
    Attempting to use HLAPI package. Can build a project that uses the components within (NetworkManager and NetworkIdentity for example) with no problem. Adding a script that inherits from one of the classes in the HLAPI will ALWAYS produce the following error when building the project:

    Copying assembly from 'Temp/com.unity.multiplayer-hlapi.Runtime.dll' to 'Library/ScriptAssemblies/com.unity.multiplayer-hlapi.Runtime.dll' failed

    This happens no matter how the package is added ("normal" reference-by-version from unity package servers, local FS, or git repo) and happens on two Windows system I've tried.



    2. How we can reproduce it using the example you attached

    Build the project. The first build may succeed, but you will get the error and any further builds will fail immediately. The NetworkBehaviour named "NetBehaviour" causes this error. You can get the build to run by changing it to a MonoBehaviour and reloading the project.
     
  2. iazlur2

    iazlur2

    Joined:
    Sep 24, 2016
    Posts:
    6
    Solution:

    1. Download "Mirror" from asset.
    2. Replace all classic Networking component of all gameobjects/prefab by Mirror scripts component (networkmanager, networkidentity, networktransform, ....).
    3. In visual studio code at right on Solution references, search "hlapi" and remove all hlapi references.
    4. Replace all your "using UnityEditor.Networking" and "using UnityEditor.Networking.X" by "using Mirror;"
    5. :)
     
    MrG likes this.
  3. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    255
    Um, Lol? I guess you're just trying to help. That's not a solution to my issue and Mirror is a step backwards. Thanks anyway.
     
  4. iazlur2

    iazlur2

    Joined:
    Sep 24, 2016
    Posts:
    6
    i search a solution for one entire day, so, i just deserted hlapi
     
  5. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    268
    This has been fixed and will be released soon as version 1.0.2, the issue was the weaver hanging on to a file lock to the unet runtime dll through some static variables (there are a lot of them).
     
    angusmf likes this.
  6. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    255
    Thank you for fixing this!!!