Hi, i recently was testing my game and wanted to build it but somehow got 2 errors, the first one is
“System.ArgumentException: An element with the same key already exists in the dictionary.
at System.Collections.Generic.Dictionary`2[System.String,System.Action].Add (System.String key, System.Action value) [0x0007e] in /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404
at CodingJarDLL.Tutorial.TutorialWindow…cctor () [0x00000] in :0
UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[ ])”
and the second one is
“ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,System.Action].Add (System.String key, System.Action value) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
CodingJarDLL.Tutorial.TutorialWindow…cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for CodingJarDLL.Tutorial.TutorialWindow
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (RuntimeTypeHandle type) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs:101)
UnityEditor.EditorAssemblies.RunClassConstructors () (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/EditorAssemblies.cs:67)”
I don’t understand why i am getting them, I think i may have done something with the main camera but i cant remember. Can someone please enplane what these errors actuary mean? i have looked and fixed up everything i can but it still pops up in my console and wont let me make a new build. Can someone please help me, if you need any additional information please just comment bellow and ill get back to you within 3 minuets of your post as i am contently refreshing this page for new answers.
This tells you what is wrong… you are trying to add an element to a dictionary using a key that has already been added before
Im sorry im new to this whole thing, but how do i fix it? and i dont get the key bit.
double click the error and it should bring you to the line of code where you are trying to add the duplicate key. either add a line of code that prints the keys to the console or set a break point on the line in monodevelop and then see where the duplicate key is coming from. without seeing the scripts code people wont be able to help you much more.
Iv tried double clicking and it doesnt work, is there any other way to search the “key” part in all scripts? i need to fix this and nothings working…
are you using some kind of 3rd party dll? if it was a problem in a script it should say the :line # of the problem. i have no idea what ‘filename unknown’ means. if the code is in a dll that might explain why it doesn’t bring you to the error. not sure though maybe someone else knows.
Everytime i try to make a build it sais this,
Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in :0
at Mono.CSharp.Driver.LoadReferences () [0x00000] in :0
at Mono.CSharp.Driver.Compile () [0x00000] in :0
at Mono.CSharp.Driver.Main (System.String[ ] args) [0x00000] in :0
Do you understand what this means? because i dont realy get it, but i need to fix it.
Nevermind, it ended up working. All i had to do is find these 3 .dll files in my assets folder and delete them. It ended up working fine and the build was built! yaha!