Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice

2 Console Errors iv never seen, Please Help

Discussion in 'Editor & General Support' started by atomicpang123abc, Apr 29, 2013.

  1. atomicpang123abc

    atomicpang123abc

    Joined:
    Apr 12, 2013
    Posts:
    15
    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 <filename unknown>: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.
     
  2. shaderbytes

    shaderbytes

    Joined:
    Nov 11, 2010
    Posts:
    900
    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
     
  3. atomicpang123abc

    atomicpang123abc

    Joined:
    Apr 12, 2013
    Posts:
    15
    Im sorry im new to this whole thing, but how do i fix it? and i dont get the key bit.
     
  4. jonjonjonjj

    jonjonjonjj

    Joined:
    Apr 28, 2013
    Posts:
    11
    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.

    http://msdn.microsoft.com/en-us/library/k7z0zy8k.aspx
     
    Last edited: Apr 29, 2013
  5. atomicpang123abc

    atomicpang123abc

    Joined:
    Apr 12, 2013
    Posts:
    15
    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...
     
  6. jonjonjonjj

    jonjonjonjj

    Joined:
    Apr 28, 2013
    Posts:
    11
    are you using some kind of 3rd party dll? if it was a problem in a script it should say the <script name>: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.

     
  7. atomicpang123abc

    atomicpang123abc

    Joined:
    Apr 12, 2013
    Posts:
    15
    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 <filename unknown>:0

    at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0

    at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0

    at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0

    at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0


    Do you understand what this means? because i dont realy get it, but i need to fix it.
     
  8. atomicpang123abc

    atomicpang123abc

    Joined:
    Apr 12, 2013
    Posts:
    15
    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!
     
unityunity