slavniyteo / one-line

One line property drawer for Unity3d
MIT License
146 stars 12 forks source link

Unity can't link assembly definitions by GUIDs from startup #42

Closed raslab closed 5 years ago

raslab commented 5 years ago

General Info OS: Windows, Ubuntu Unity Version: 2018.2.6f1 (ubuntu), 2018.4.0f1 (win), 2018.4.6f1 (win) OneLine Version: latest master branch OneLine Installation: Unity Package Manager


Describe the bug STR:

  1. Create new project
  2. Add to Packages/manifest.json
    {
    "dependencies": {
    "st.rect-ex": "https://github.com/slavniyteo/rect-ex.git#master",
    "st.one-line": "https://github.com/slavniyteo/one-line.git#master"
    },
    "testables": [
    "st.rect-ex",
    "st.one-line"
    ]
    }
  3. Switch to Unity and catch importing errors:
    Assembly has reference to non-existent assembly 'GUID:73c70a6eb6b6f444c878926f743350f6' (Packages/st.rect-ex/Tests/Editor/Unity.st.rect-ex.Editor.Tests.asmdef)
    Assembly has reference to non-existent assembly 'GUID:7a0017bf928d9644fa38a04cabefce63' (Packages/st.one-line/Tests/Editor/OneLine.Tests.Editor.asmdef)
    Assembly has reference to non-existent assembly 'GUID:48490628f29f5a745823c646508b1c74' (Packages/st.one-line/Documentation/Examples/OneLine.Examples.asmdef)
    Assembly has reference to non-existent assembly 'GUID:73c70a6eb6b6f444c878926f743350f6' (Packages/st.one-line/Editor/OneLine.Editor.asmdef)
    Assembly has reference to non-existent assembly 'GUID:73c70a6eb6b6f444c878926f743350f6' (Packages/st.one-line/Runtime/OneLine.Runtime.asmdef)
  4. Also, for test-assemblies wasn't turned on "Test assembly" flag

Expected:

  1. Importing without errors
  2. "Test assembly" flag turned on for test assemblies

Additional context For me solution of this problem was manual updating links in *.asmdef files from GUIDs to relative paths. For example, for OneLine.Runtime.asmdef change:

{
  "name": "st.one-line.Runtime",
  "references": [
    "GUID:73c70a6eb6b6f444c878926f743350f6"
  ]
}

to

{
  "name": "st.one-line.Runtime",
  "references": [
        "st.rect-ex.Runtime"
  ]
}

Can this fix be used for plugin? Will it be compatible with UPM on 2019+ version of Unity / Asset store installation?

raslab commented 5 years ago

Also, this issue related to rect-ex/Tests/Editor/Unity.st.rect-ex.Editor.Tests.asmdef in rect-ex plugin

slavniyteo commented 5 years ago

Sorry, I can't now run Unity and check, but these errors look familiar.

Do these errors appears after restarting Unity? If I'm not mistaken, I saw these errors when I was migrating OneLine & RectEx to UPM few months ago.

I notice, that all missed GUIDs are not actually absent. As an instance, GUID from OneLine.Tests.Editor points to OneLine.Runtime.

My guess is that changing GUIDs to relative names in project.json helps only because of reloading package.json or restarting Unity.

raslab commented 5 years ago

No, reloading of Unity / moving plugins to local repository or manual installation not helps also. For me helps only manual re-linking of assembly definitions.

Looks like GUIDs for assembly definitions it is 2019.1+ Unity feature: it exists in new documentation but missed for 2018.4 LTS version.

slavniyteo commented 5 years ago

Thank you for contribution, merged successfully.

raslab commented 5 years ago

Cool, thanks, from now we can connect plugin to projects on LTS version via UPM 🔥🔥🔥

P.S.: @slavniyteo, can you, also, approve https://github.com/slavniyteo/rect-ex/pull/4 ? 😃