Internal Compiler Error: Key Duplication

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.

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.

Submitted the bug report. Hope it gets resolved soon!

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.

this is a long shot but have you tried changing your class’s method name to something else? ie dont name it “Generate”

I renamed it to CreateMesh instead, and the problem remains.

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.

For any developers who could help me, the case number for my support request is 648301.

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!