Burst Inspector Error - Could not load inspector/Attempting to insert same key: Unity.Jobs.IJob

Hey,

Feel like I’m missing something here - just been using burst since yesterday. Created my first Job and it’s using [BurstCompile]. Everything is fast WAHOO!

But trying to open the burst inspector I get this error:

Could not load Inspector: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: An item with the same key has already been added. Key: Unity.Jobs.IJob
  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.Burst.Editor.BurstReflection.FindExecuteMethods (System.Collections.Generic.List`1[T] assemblyList, Unity.Burst.Editor.BurstReflectionAssemblyOptions options) [0x0008e] in \Editor\BurstReflection.cs:69
  at Unity.Burst.Editor.BurstInspectorGUI+<>c__DisplayClass33_0.<OnEnable>b__1 () [0x00000] in Library\PackageCache\com.unity.burst@1.5.4\Editor\BurstInspectorGUI.cs:152
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Threading.Tasks.Task.Execute () [0x00010] in <695d1cc93cca45069c528c15c9fdd749>:0
   --- End of inner exception stack trace ---

Using Burst 1.5.6 (tried on 1.5.4 also) with Unity 2020.3.14f1. Jobs @ Version 0.11.0-preview.6

We’ll need a repro for this - maybe our method resolving has a bug that we’re not aware of!

Aha - seems to be an issue when the project is in Nintendo Switch dev environment.

Just logging a bug now!

2 Likes

I still have this issue in Unity 2019.4.40LTS, JOBS 0.2.10preview.13, Mathematics 1.1.0 and Collections 0.9.0preview.6. Full error:

Could not load Inspector: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: An item with the same key has already been added. Key: Unity.Jobs.IJob
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000c1] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at Unity.Burst.Editor.BurstReflection.FindExecuteMethods (System.Collections.Generic.List`1[T] assemblyList, Unity.Burst.Editor.BurstReflectionAssemblyOptions options) [0x0009c] in M:\PROJECT FM DE\Library\PackageCache\com.unity.burst@1.7.4\Runtime\Editor\BurstReflection.cs:70
  at Unity.Burst.Editor.BurstInspectorGUI+<>c__DisplayClass51_0.<OnEnable>b__1 () [0x00001] in M:\PROJECT FM DE\Library\PackageCache\com.unity.burst@1.7.4\Editor\BurstInspectorGUI.cs:222
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at System.Threading.Tasks.Task.Execute () [0x00010] in <eae584ce26bc40229c1b1aa476bfa589>:0
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.ArgumentException: An item with the same key has already been added. Key: Unity.Jobs.IJob
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000c1] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at Unity.Burst.Editor.BurstReflection.FindExecuteMethods (System.Collections.Generic.List`1[T] assemblyList, Unity.Burst.Editor.BurstReflectionAssemblyOptions options) [0x0009c] in M:\PROJECT FM DE\Library\PackageCache\com.unity.burst@1.7.4\Runtime\Editor\BurstReflection.cs:70
  at Unity.Burst.Editor.BurstInspectorGUI+<>c__DisplayClass51_0.<OnEnable>b__1 () [0x00001] in M:\PROJECT FM DE\Library\PackageCache\com.unity.burst@1.7.4\Editor\BurstInspectorGUI.cs:222
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at System.Threading.Tasks.Task.Execute () [0x00010] in <eae584ce26bc40229c1b1aa476bfa589>:0 <---

UnityEngine.Debug:LogError (object)
Unity.Burst.Editor.BurstInspectorGUI/<>c__DisplayClass51_0:<OnEnable>b__2 (System.Threading.Tasks.Task`1<Unity.Burst.Editor.BurstReflection/FindExecuteMethodsResult>) (at Library/PackageCache/com.unity.burst@1.7.4/Editor/BurstInspectorGUI.cs:261)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback

Hey, which burst version are you on?
If it’s an old version could you try and update it to a never version, and see if the bug still occur?
This can be done by:

  1. Opening Package Manager
  2. Clicking the plus icon top left corner
  3. Choose “Add package by name…”
  4. Insert:
  • name: com.unity.burst
  • version: 1.8.2

The higest I can see to install is (1.7.4):
8629863--1159947--upload_2022-12-2_5-1-51.png
And I don’t have the “Add package by name” option, this is what I have:
8629863--1159950--upload_2022-12-2_5-4-7.png
I’m on Unity 2019.4.40LTS

I could definitely use a repro for this if possible?

In regards to upgrading burst: It is possible to switch to a specific version by going into to package manifest, located at something like “root-of-your-project/Packages/manifest.json”. Here you can write “1.8.2” next to “com.unity.burst” under dependencies. If “com.unity.burst” is not present, you can add it to the dependency list like:

"dependencies": {
    "com.unity.burst": "1.8.2",
    // All other dependencies
}

"

Scratch upgrading to burst 1.8.2.
It’s only supported for editor 2020.3+,
sry

1 Like

I can try to upgrade to 2020.3/1.8.2 and see if it works. But only to confirm you if the bug still there or not, we can’t move to 2020/2021 due to runtime degradation with Nintendo Switch builds though.