Error after update to Unity 2021.3.16f1 LTS

Hello,

I have been using Unity 2021 LTS from the beginning and updating it every 15 days, but with last update I am getting this error:

Failed to find entry-points:
System.AggregateException: One or more errors occurred. (An item with the same key has already been added. Key: ba90c8be510d7e31cc589f2de9f828e6) ---> System.ArgumentException: An item with the same key has already been added. Key: ba90c8be510d7e31cc589f2de9f828e6
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000dd] in <05089c1b6989455fb1452c627044bac4>:0
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <05089c1b6989455fb1452c627044bac4>:0
  at Burst.Compiler.IL.Hashing.Storage.NameToTokenDictionary.AddHash (Burst.Compiler.IL.Helpers.Hash128& hash, System.Int32 token) [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinitionImpl (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, Burst.Compiler.IL.Hashing.CacheBuilder.Util.CachingMetadataReader metadataReader, Burst.Compiler.IL.Helpers.Hash128Builder hashBuilder) [0x000fc] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinition (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, Burst.Compiler.IL.Hashing.CacheBuilder.Util.CachingMetadataReader metadataReader) [0x00006] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+<>c__DisplayClass13_0.<HashImpl>b__5 (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, System.Threading.Tasks.ParallelLoopState loopState, System.Int64 i) [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.ForEach[T] (System.Collections.Generic.IEnumerable`1[T] elements, System.Action`3[T1,T2,T3] callback) [0x00018] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+<>c__DisplayClass13_0.<HashImpl>b__0 () [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <05089c1b6989455fb1452c627044bac4>:0
  at System.Threading.Tasks.Task.Execute () [0x00000] in <05089c1b6989455fb1452c627044bac4>:0
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks, System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x001c8] in <05089c1b6989455fb1452c627044bac4>:0
  at System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks, System.Int32 millisecondsTimeout) [0x00000] in <05089c1b6989455fb1452c627044bac4>:0
  at System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks) [0x00000] in <05089c1b6989455fb1452c627044bac4>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashImpl () [0x00243] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashAssembly (System.String filePath, System.Threading.Tasks.TaskFactory taskFactory) [0x00008] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheLoader.CreateHashingResult (Mono.Cecil.AssemblyNameReference assemblyNameReference, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.Helpers.DebugLogWriter debugLogWriter) [0x001b1] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore.GetAssemblyState (System.String assemblyName, Burst.Compiler.IL.AssemblyLoader assemblyLoader) [0x000a0] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Server.EntryPointMethodFinder.LoadAllAssemblyReferences (Mono.Cecil.AssemblyDefinition asmDef, System.Collections.Generic.Dictionary`2[TKey,TValue] visited, System.Collections.Generic.Dictionary`2[TKey,TValue] jobProducers, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader) [0x00020] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Server.EntryPointMethodFinder.LoadAllAssemblyReferences (Mono.Cecil.AssemblyDefinition asmDef, System.Collections.Generic.Dictionary`2[TKey,TValue] visited, System.Collections.Generic.Dictionary`2[TKey,TValue] jobProducers, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader) [0x001de] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Server.EntryPointMethodFinder.FindEntryPoints (System.String[] rootAssemblyNames, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, Burst.Compiler.IL.Server.ProfileDelegate profileCallback, System.Boolean includeRootAssemblyReferences, System.Boolean splitTargets, Burst.Compiler.IL.Helpers.DebugLogWriter debugWriter) [0x00071] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Server.FindMethodsJob.Execute (Burst.Compiler.IL.Server.CompilerServerJobExecutionContext context) [0x00133] in <a2dd15248a25411e914af2a2c82fb63f>:0
---> (Inner Exception #0) System.ArgumentException: An item with the same key has already been added. Key: ba90c8be510d7e31cc589f2de9f828e6
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000dd] in <05089c1b6989455fb1452c627044bac4>:0
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <05089c1b6989455fb1452c627044bac4>:0
  at Burst.Compiler.IL.Hashing.Storage.NameToTokenDictionary.AddHash (Burst.Compiler.IL.Helpers.Hash128& hash, System.Int32 token) [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinitionImpl (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, Burst.Compiler.IL.Hashing.CacheBuilder.Util.CachingMetadataReader metadataReader, Burst.Compiler.IL.Helpers.Hash128Builder hashBuilder) [0x000fc] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinition (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, Burst.Compiler.IL.Hashing.CacheBuilder.Util.CachingMetadataReader metadataReader) [0x00006] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+<>c__DisplayClass13_0.<HashImpl>b__5 (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, System.Threading.Tasks.ParallelLoopState loopState, System.Int64 i) [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.ForEach[T] (System.Collections.Generic.IEnumerable`1[T] elements, System.Action`3[T1,T2,T3] callback) [0x00018] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+<>c__DisplayClass13_0.<HashImpl>b__0 () [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <05089c1b6989455fb1452c627044bac4>:0
  at System.Threading.Tasks.Task.Execute () [0x00000] in <05089c1b6989455fb1452c627044bac4>:0 <---


While compiling job:

Anybody could help me with it? Is it a bug with last Unity Editor version?

Thanks!

1 Like

Hi @Tornar !

Which version of Burst are you using there? If it’s earlier than 1.8.2, please could you try 1.8.2 to see if it fixes your issue?

If 1.8.2 doesn’t fix the issue, we’ll need a bug report, which you can submit via Help > Report a Bug.

1 Like

Same here! 1.8.2 also. I have to roll back to 2021.3.15f1. Can not make it work in 2021.3.16f1. Any one has the same issue?

Yes! I was using 1.8.x, not sure what specific version but it was last version I could update through “Package Manager”. I don’t understand why Unity 2021 LTS is using 1.8.x Burst version while Unity 2022 is using 1.7.4

same question .
2021.3.16 bursh:1.8.2

Hi, we’d really like to investigate this problem, but for that we’ll need a bug logged (and attached repro project / repro steps). Would one of you who have this issue be willing to do that please? :slight_smile: You can do Help > Report a Bug.

I updated to Unity 2022.2.1f1 and error had disappeared, but today after update to last Unity 2022.2.2f1, it is using Burst 1.8.2, and I am getting the same error :confused:

I’ll try report a bug @tim_jones , I hope you can fix it soon, because it is happening to me with all current Unity versions…

It’s the error I’m getting with Unity 2022.2.2f1

Failed to find entry-points:
System.AggregateException: One or more errors occurred. (An item with the same key has already been added. Key: ba90c8be510d7e31cc589f2de9f828e6) ---> System.ArgumentException: An item with the same key has already been added. Key: ba90c8be510d7e31cc589f2de9f828e6
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000dd] in <0c14436887c540e9a57b425f835ba9ed>:0
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <0c14436887c540e9a57b425f835ba9ed>:0
  at Burst.Compiler.IL.Hashing.Storage.NameToTokenDictionary.AddHash (Burst.Compiler.IL.Helpers.Hash128& hash, System.Int32 token) [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinitionImpl (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, Burst.Compiler.IL.Hashing.CacheBuilder.Util.CachingMetadataReader metadataReader, Burst.Compiler.IL.Helpers.Hash128Builder hashBuilder) [0x000fc] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinition (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, Burst.Compiler.IL.Hashing.CacheBuilder.Util.CachingMetadataReader metadataReader) [0x00006] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+<>c__DisplayClass13_0.<HashImpl>b__5 (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, System.Threading.Tasks.ParallelLoopState loopState, System.Int64 i) [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.ForEach[T] (System.Collections.Generic.IEnumerable`1[T] elements, System.Action`3[T1,T2,T3] callback) [0x00018] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+<>c__DisplayClass13_0.<HashImpl>b__0 () [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <0c14436887c540e9a57b425f835ba9ed>:0
  at System.Threading.Tasks.Task.Execute () [0x00000] in <0c14436887c540e9a57b425f835ba9ed>:0
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks, System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x001c8] in <0c14436887c540e9a57b425f835ba9ed>:0
  at System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks, System.Int32 millisecondsTimeout) [0x00000] in <0c14436887c540e9a57b425f835ba9ed>:0
  at System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks) [0x00000] in <0c14436887c540e9a57b425f835ba9ed>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashImpl () [0x00243] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashAssembly (System.String filePath, System.Threading.Tasks.TaskFactory taskFactory) [0x00008] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheLoader.CreateHashingResult (Mono.Cecil.AssemblyNameReference assemblyNameReference, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.Helpers.DebugLogWriter debugLogWriter) [0x001b1] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore.GetAssemblyState (System.String assemblyName, Burst.Compiler.IL.AssemblyLoader assemblyLoader) [0x000a0] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Server.EntryPointMethodFinder.LoadAllAssemblyReferences (Mono.Cecil.AssemblyDefinition asmDef, System.Collections.Generic.Dictionary`2[TKey,TValue] visited, System.Collections.Generic.Dictionary`2[TKey,TValue] jobProducers, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader) [0x00020] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Server.EntryPointMethodFinder.LoadAllAssemblyReferences (Mono.Cecil.AssemblyDefinition asmDef, System.Collections.Generic.Dictionary`2[TKey,TValue] visited, System.Collections.Generic.Dictionary`2[TKey,TValue] jobProducers, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader) [0x001de] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Server.EntryPointMethodFinder.FindEntryPoints (System.String[] rootAssemblyNames, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, Burst.Compiler.IL.Server.ProfileDelegate profileCallback, System.Boolean includeRootAssemblyReferences, System.Boolean splitTargets, Burst.Compiler.IL.Helpers.DebugLogWriter debugWriter) [0x00071] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Server.FindMethodsJob.Execute (Burst.Compiler.IL.Server.CompilerServerJobExecutionContext context) [0x00133] in <a2dd15248a25411e914af2a2c82fb63f>:0
---> (Inner Exception #0) System.ArgumentException: An item with the same key has already been added. Key: ba90c8be510d7e31cc589f2de9f828e6
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x000dd] in <0c14436887c540e9a57b425f835ba9ed>:0
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <0c14436887c540e9a57b425f835ba9ed>:0
  at Burst.Compiler.IL.Hashing.Storage.NameToTokenDictionary.AddHash (Burst.Compiler.IL.Helpers.Hash128& hash, System.Int32 token) [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinitionImpl (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, Burst.Compiler.IL.Hashing.CacheBuilder.Util.CachingMetadataReader metadataReader, Burst.Compiler.IL.Helpers.Hash128Builder hashBuilder) [0x000fc] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinition (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, Burst.Compiler.IL.Hashing.CacheBuilder.Util.CachingMetadataReader metadataReader) [0x00006] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+<>c__DisplayClass13_0.<HashImpl>b__5 (System.Reflection.Metadata.TypeDefinitionHandle typeDefinitionHandle, System.Threading.Tasks.ParallelLoopState loopState, System.Int64 i) [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.ForEach[T] (System.Collections.Generic.IEnumerable`1[T] elements, System.Action`3[T1,T2,T3] callback) [0x00018] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher+<>c__DisplayClass13_0.<HashImpl>b__0 () [0x00000] in <a2dd15248a25411e914af2a2c82fb63f>:0
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <0c14436887c540e9a57b425f835ba9ed>:0
  at System.Threading.Tasks.Task.Execute () [0x00000] in <0c14436887c540e9a57b425f835ba9ed>:0 <---


While compiling job:

And it is the bug report email:

New Incident created: IN-28703 - Getting Error after update to Unity 2022.2.2f1 for Burts version

@tim_jones please if you can follow-up this case, it would be great because we are going to release our game in a few months and it is a disturbing bug.

Thanks!

2 Likes

Thanks @Tornar - I can see the bug report, I’ll follow-up.

1 Like

@Tornar I’ve found the problem: in one of your precompiled dlls, there’s a type with two fields that have the same name. I’d guess this happens because you’ve run an obfuscator on that dll? Technically, types aren’t supposed to have fields with duplicate names, and Burst relies on that rule, which is why it’s breaking when there are fields with duplicate names.

I’ll DM you with the details about which dll / type / field, to avoid leaking that information here. If you’re able to set some obfuscator options to stop it giving duplicate names to fields, that should fix the problem.

We can also see what we can do on our end to make Burst more tolerant of this, but as I say, the ECMA335 standard for .NET dlls does say that field names should be unique, within an owner type.

4 Likes

Thanks a lot for the feedback @tim_jones !

Unfortunately that DLL belongs to one Unity Assets I bought:

I am speaking with the dev at the moment to try find a solution.

The developer of this awesome asset was so kind to send me the code associated to that DLL and now everything is working correctly with last Unity version,

Thanks everybody for the help :slight_smile:

1 Like

Hi @tim_jones ! I’m also seeing the same error while following the ML-Agent Hummingbird tutorial after installing the latest ML-Agent package.

Unity version is also 2021.3.16 and the ML-Agent package is 2.0.1. Info specific to this combination in the error stack:

System.Exception: Unexpected exception while collecting types in assembly `Unity.Barracuda.ONNX, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null` ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Google.Protobuf, Version=3.9.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604'

Barracuda package is v 2.0.0 and Burst version is 1.8.2 if it matters.

Hi @derzorngottes - next time you see that error in the Editor, please could you report a bug via Help > Report a Bug. That will help me get to the problem much more quickly, rather than going through the ML-Agent Hummingbird tutorial myself :slight_smile: If you do, then please let me know the IN-XXXX number here, and I’ll track it down.

This looks like a different problem from the one that @Tornar mentioned above.

Actually @derzorngottes I just tried creating an empty project from the URP template, and then added the ML-Agent package, and I saw the same error. This is a known issue in Burst 1.8.2, and will be fixed in 1.8.3. For now you can workaround it by restarting the Editor.

Hey @tim_jones , we have same problem. I think I can’t submit a bug report because of project is including too much dlls and the size of project is about ~60GB. Previously I was using Unity version 2021.3.2 and fixed this issue by downgrading Burst to version 1.6.6. Now I switched my unity version to 2021.3.16 and now I can’t downgrading Burst version, because some unity packages like URP is need Burst 1.8.2. I can’t build my project. Do you have any suggestion?

BuildFailedException: Burst compiler (1.8.2) failed running

stdout:
Error: Failed to find entry-points:
System.AggregateException: One or more errors occurred. ---> System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinitionImpl(TypeDefinitionHandle typeDefinitionHandle, CachingMetadataReader metadataReader, Hash128Builder hashBuilder)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinition(TypeDefinitionHandle typeDefinitionHandle, CachingMetadataReader metadataReader)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.<>c__DisplayClass13_0.<HashImpl>b__5(TypeDefinitionHandle typeDefinitionHandle, ParallelLoopState loopState, Int64 i)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.ForEach[T](IEnumerable`1 elements, Action`3 callback)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.<>c__DisplayClass13_0.<HashImpl>b__0()
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashImpl()
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashAssembly(String filePath, TaskFactory taskFactory)
   at Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheLoader.CreateHashingResult(AssemblyNameReference assemblyNameReference, AssemblyLoader assemblyLoader, DebugLogWriter debugLogWriter)
   at Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore.GetAssemblyState(String assemblyName, AssemblyLoader assemblyLoader)
   at Burst.Compiler.IL.Server.EntryPointMethodFinder.LoadAllAssemblyReferences(AssemblyDefinition asmDef, Dictionary`2 visited, Dictionary`2 jobProducers, HashCacheAssemblyStore assemblyStore, AssemblyLoader assemblyLoader)
   at Burst.Compiler.IL.Server.EntryPointMethodFinder.LoadAllAssemblyReferences(AssemblyDefinition asmDef, Dictionary`2 visited, Dictionary`2 jobProducers, HashCacheAssemblyStore assemblyStore, AssemblyLoader assemblyLoader)
   at Burst.Compiler.IL.Server.EntryPointMethodFinder.FindEntryPoints(String[] rootAssemblyNames, HashCacheAssemblyStore assemblyStore, AssemblyLoader assemblyLoader, NativeCompilerOptions options, ProfileDelegate profileCallback, Boolean includeRootAssemblyReferences, Boolean splitTargets, DebugLogWriter debugWriter)
   at Burst.Compiler.IL.Server.FindMethodsJob.Execute(CompilerServerJobExecutionContext context)
---> (Inner Exception #0) System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinitionImpl(TypeDefinitionHandle typeDefinitionHandle, CachingMetadataReader metadataReader, Hash128Builder hashBuilder)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.HashTypeDefinition(TypeDefinitionHandle typeDefinitionHandle, CachingMetadataReader metadataReader)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.<>c__DisplayClass13_0.<HashImpl>b__5(TypeDefinitionHandle typeDefinitionHandle, ParallelLoopState loopState, Int64 i)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.ForEach[T](IEnumerable`1 elements, Action`3 callback)
   at Burst.Compiler.IL.Hashing.CacheBuilder.ILHasher.<>c__DisplayClass13_0.<HashImpl>b__0()
   at System.Threading.Tasks.Task.Execute()<---

stderr:

Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at Library/PackageCache/com.unity.burst@1.8.2/Editor/BurstAotCompiler.cs:1728)
Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at Library/PackageCache/com.unity.burst@1.8.2/Editor/BurstAotCompiler.cs:1594)
Unity.Burst.Editor.BurstAotCompiler+BclRunner.RunManagedProgram (System.String exe, System.String args, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at Library/PackageCache/com.unity.burst@1.8.2/Editor/BurstAotCompiler.cs:1569)
Unity.Burst.Editor.BurstAotCompiler.OnPostBuildPlayerScriptDLLsImpl (Unity.Burst.Editor.BurstAotCompiler+BurstAOTSettings settings, UnityEditor.Compilation.Assembly[] playerAssemblies) (at Library/PackageCache/com.unity.burst@1.8.2/Editor/BurstAotCompiler.cs:710)
Unity.Burst.Editor.BurstAOTCompilerPostprocessor.DoGenerate (UnityEditor.Compilation.Assembly[] assemblies) (at Library/PackageCache/com.unity.burst@1.8.2/Editor/BurstAotCompiler.cs:265)
Unity.Burst.Editor.BurstAOTCompilerPostprocessor.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.unity.burst@1.8.2/Editor/BurstAotCompiler.cs:189)
UnityEditor.Build.BuildPipelineInterfaces.OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport report) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions)
EditorBuildProcessor:BuildPlayerHandler(BuildPlayerOptions) (at Assets/_Game/Scripts/Editor/EditorBuildProcessor.cs:38)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Hi @yusufdemir2012 - that error does indeed look the same as @Tornar 's error. Are you using any precompiled and obfuscated dlls in your project?

Actually I am not sure about that, how do I know?

Precompiled dlls would be any .dll files in your Assets folder, that are not compiled by the script compilation pipeline, but are already compiled by you or third parties and then added to your project as already-compiled dlls. They can also exist in packages, although I’m pretty sure that Unity-provided packages don’t include obfuscated dlls, but third-party packages might contain them.

The next step is finding out if any of the precompiled assemblies are obfuscated. That’s a bit harder, if you didn’t compile the assemblies yourself. Usually you need to do something like opening the .dll in a tool like ILSpy, and looking to see if any of the type names or method names have been obfuscated.

I’m getting the same error as OP in Unity 2021.3.16 and 2021.3.17. As a result, seems like burst is stuck at 99% compilation.

@tim_jones