Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Internal Compiler Error: Key Duplication

Discussion in 'Unity 5 Pre-order Beta' started by JasonBricco, Nov 15, 2014.

  1. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    I have this error and have absolutely no idea what is causing it or how to fix it. And it's putting my work on hold at the moment:

    Internal compiler error. See the console log for more information. output was:
    Unhandled Exception: System.ArgumentException: Key duplication when adding: MethodBuilder [BaseChunk::Generate]


    I see nothing wrong with my BaseChunk class or my Generate method on that class. And, being the somewhat new programmer I am, have no idea what MethodBuilder is or how there's any sort of key duplication happening relating to it.

    This seems entirely out of my control. I can't see any changes I made today that would lead to this.

    Has anyone seen errors like this? Do you know how to handle them? Right now I'm assuming it's a Unity bug.

    Thanks in advance.
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Looks like a bug to me as well. The best thing you can do is to submit a bug report with your actual project or a reproduction.
     
  3. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    Submitted the bug report. Hope it gets resolved soon!
     
  4. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    You should also post the case number of your bug, such that if a developer finds this thread or is pointed to it, can directly check it and doesn't need to search for it.
     
  5. shaderbytes

    shaderbytes

    Joined:
    Nov 11, 2010
    Posts:
    900
    this is a long shot but have you tried changing your class's method name to something else? ie dont name it "Generate"
     
  6. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    I renamed it to CreateMesh instead, and the problem remains.
     
  7. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    Support told me that it is a bug and that they can't guarantee when the solution will be publicly available.

    I guess that's what I get for using beta. I definitely should not be using beta for my main project.

    Any developers able to provide me a workaround? I'm in need.
     
    Last edited: Nov 18, 2014
  8. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    For any developers who could help me, the case number for my support request is 648301.
     
  9. JasonBricco

    JasonBricco

    Joined:
    Jul 15, 2013
    Posts:
    956
    Bump, in case anyone else has found a solution to this yet. I sure haven't.

    Edit:

    I've found a solution now for myself. My issue was in an abstract base class, BaseChunk. I still don't know what it was. All I did was switch to using an interface instead of an abstract base class, and it works now. I'd rather have not used an interface for this purpose, but at least I can get back to work now!
     
    Last edited: Nov 19, 2014