mujoco icon indicating copy to clipboard operation
mujoco copied to clipboard

Unity warning: "Rename the assemblies to avoid hard to diagnose issues and crashes."

Open hubbardp opened this issue 2 years ago • 2 comments

At least with Unity 2021.2.8f1 on Windows, using the Package Manager to add the MuJoCo Unity package produces the following warning:

“Plugin 'Packages/org.mujoco/mujoco.dll' has the same filename as Assembly Definition File 'Packages/org.mujoco/Runtime/Mujoco.asmdef'. Rename the assemblies to avoid hard to diagnose issues and crashes.”

A solution that seems to be working (i.e., no more warning messages, both PlayMode and EditMode tests pass) is to rename mujoco/unity/Runtime/Mujoco.asmdef to mujoco/unity/Runtime/Mujoco.Runtime.asmdef. This renaming is consistent with Unity's suggested naming conventions:

https://docs.unity3d.com/Manual/cus-asmdef.html

Note that in addition to renaming the Mujoco.asmdef file, the contents of the file must be changed slightly:

    "name": "Mujoco.Runtime",

And then references to it must be changed in the other .asmdef files. mujoco/unity/Editor/Mujoco.Editor.asmdef:

    "references": [
        "Mujoco.Runtime"
    ],

mujoco/unity/Tests/Editor/Mujoco.Editor.Tests.asmdef:

    "references": [
        "UnityEngine.TestRunner",
        "UnityEditor.TestRunner",
        "Mujoco.Runtime",
        "Mujoco.Editor"
    ],

mujoco/unity/Tests/Runtime/Mujoco.Tests.asmdef:

    "references": [
        "UnityEngine.TestRunner",
        "Mujoco.Runtime"
    ],

Note that the name of the last such file, mujoco/unity/Tests/Runtime/Mujoco.Tests.asmdef, would be better and more consistent were it changed to Mujoco.Runtime.Tests.asmdef, but such a change is not strictly necessary to fix the warnings.

hubbardp avatar Feb 04 '22 13:02 hubbardp

This is very useful, thanks. I'll prepare this change and push it in the next batch.

erez-tom avatar Feb 04 '22 20:02 erez-tom

pls help me Plugin 'Assets/GoogleMobileAds/GoogleMobileAds.dll' has the same filename as Assembly Definition File 'Assets/GoogleMobileAds/GoogleMobileAds.asmdef'. Rename the assemblies to avoid hard to diagnose issues and crashes.

Anashb2007 avatar Oct 16 '23 15:10 Anashb2007