Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Live Link throws ArgumentException

Discussion in 'Entity Component System' started by CaseyHofland, Apr 10, 2021.

  1. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    610
    I have a simple entities project that I was using to learn the dark arts. I finished my rotating cubes scene and, happy with my newfound knowledge, closed my laptop and went to bed.

    The following day, all I did was create different jobs (all to rotate cubes) and when I wanted to test my original job, Live Link throws
    ArgumentException: An item with the same key has already been added. Key: a6e3011708a281c4fb3b99ed0e2bc68d

    on startup. Unpausing the scene immediately rethrows the error.

    I do not have Live Link started. And yet, this line seems to be the problem:
    at Library/PackageCache/com.unity.entities@0.17.0-preview.41/Unity.Scenes.Editor/LiveLinkConnection.cs:431)


    Lastly, Live Conversion off doesn't fix it and restarting Unity doesn't help either.

    Windows 10
    Unity 2021.1.0f1
    Entities 0.17.0-preview.41
    DOTS Editor 0.12.0-preview.6

    ArgumentException: An item with the same key has already been added. Key: a6e3011708a281c4fb3b99ed0e2bc68d
    at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000c1] in <695d1cc93cca45069c528c15c9fdd749>:0
    at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
    at Unity.Scenes.Editor.LiveLinkConnection.Update (System.Collections.Generic.List`1[T] changeSets, Unity.Collections.NativeList`1[T] loadScenes, Unity.Collections.NativeList`1[T] unloadScenes, Unity.Scenes.LiveLinkMode mode) [0x000dd] in C:\Users\SKIKK\Desktop\Projects\Unity\Projects\DOTS Best Practices Examples\Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Scenes.Editor\LiveLinkConnection.cs:431
    at Unity.Scenes.Editor.EditorSubSceneLiveLinkSystem.OnUpdate () [0x00051] in C:\Users\SKIKK\Desktop\Projects\Unity\Projects\DOTS Best Practices Examples\Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Scenes.Editor\EditorSubSceneLiveLinkSystem.cs:44
    at Unity.Entities.ComponentSystem.Update () [0x0005f] in C:\Users\SKIKK\Desktop\Projects\Unity\Projects\DOTS Best Practices Examples\Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ComponentSystem.cs:114
    at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x000c7] in C:\Users\SKIKK\Desktop\Projects\Unity\Projects\DOTS Best Practices Examples\Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ComponentSystemGroup.cs:472
    UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    UnityEngine.Logger:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    Unity.Debug:LogException(Exception) (at Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\Stubs\Unity\Debug.cs:19)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ComponentSystemGroup.cs:477)
    Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ComponentSystemGroup.cs:417)
    Unity.Entities.ComponentSystem:Update() (at Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ComponentSystem.cs:114)
    Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ComponentSystemGroup.cs:472)
    Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ComponentSystemGroup.cs:417)
    Unity.Entities.ComponentSystem:Update() (at Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ComponentSystem.cs:114)
    Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library\PackageCache\com.unity.entities@0.17.0-preview.41\Unity.Entities\ScriptBehaviourUpdateOrder.cs:333)

    I have not created a bug report yet, since I don't know if I'm missing something really simple. All this is quite new to me. In any case, thanks for taking the time to read this.
     

    Attached Files:

    Last edited: Apr 10, 2021
  2. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    610
    Coming back later with fresh ideas, simply unloading and reimporting my subscene did the trick. It is still unclear to me why this happened however, but at least for now you can use this easy fix.
     
    lclemens likes this.
  3. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    760
    Thanks, that fixed it for me too.