- Home /
Internal Compiler Error
I am getting internal compiler error when i try to debug my unity scripts on Monodevelop-unity. (I could have been able to debug previously). My project contains both c# script and java scripts. I am using NGUI, prime31 plugins.
I am totally stucked, i searched previous posts but i could not resolve the problem.
Regards
What is the internal error you are getting? What happened just before it started?
Normally these things need to be reported to Unity Support
This is the output /Users/berkantakin/Documents/berkant/UnityBackup/Billard copy 5/New Unity Project/Assets/ScGameCtrl.cs(35,35): Error CS0584: Internal compiler error: $Start$201 (CS0584) (Assembly-CSharp)
I am trying to access javascript object inside c# script.
Yeah, they happen - it's probably the way you are doing something else in the code or the way you have declared the types. I can get them if I make overlapping generic parameters in C#, but as it's an internal error there's probably not much that can be done and you should definitely report it to Unity Support with your project attached so that they have a chance to fix it.
Feel free to post your code, if it's actually an error that's spottable causing the internal error there is a remote chance the community here can help.
Hi, I have this 2 problems:
Internal compiler error. See the console log for more information. output was:error CS0016: Could not write to file `Temp/Assembly-CSharp-firstpass.dll', cause: Access to the path "C:\Users\JG$$anonymous$$\Documents\New Unity Project 1\Temp\Assembly-CSharp-firstpass.dll.mdb" is denied.
Internal compiler error. See the console log for more information. output was:BCE0011: An error occurred during the execution of the step 'Boo.Lang.Compiler.Steps.SaveAssembly': 'Access to the path "C:\Users\JG$$anonymous$$\Documents\New Unity Project 1\Temp\Assembly-UnityScript-firstpass.dll.mdb" is denied.'.
Can you guys help me?
Answer by Venryx · Feb 27, 2014 at 07:44 PM
I've been having internal compiler errors in my project also, and there are a couple things I've found that could help.
First, there is a technique which works well for narrowing-down where the internal compiler error happens.
First the thought process:
A) I noticed that compiler errors showing up in Visual Studio, when I attempted to build the project there (which failed because Unity hadn't built the DLL file, btw), were not showing up in the Unity console/error log.
B) This made me realize that the internal compiler error must be happening at some specific line in some specific file, and that once it hit that line, it stopped compiling the rest of the files. (and thus it never noticed the normal code issues (e.g. "int i = 0 / 0;") that Visual Studio picked up)
C) I looked into the Unity Editor logs, and noticed that the files were all being sent to the compiler in alphabetical order--in other words, in basically the same order you see them in the Project view. (the one difference being how they handle capital letters--Unity and Visual Studio consider 'a' to be before 'B', whereas the compiler considers 'a' to be after 'B', since 'B' is capitalized, and it always puts capitalized letters first (presumably because capitalized letters come first in the character map))
D) I realized that I could find which file the 'internal compiler error' happened in by intentionally creating normal compile errors at the bottom of each file, in turn, until I saw the normal error not show up in the Console. (indicating that it came after the internal-compiler-error-causing line)
So now:
Tip #1) The technique.
If you get an 'internal compiler error':
1) Place the following code at the very bottom of the first (alphabetically speaking) script file: (in other words, the top-most script file in the Project view)
class CompileBreaker { public CompileBreaker() { var i = 0 / 0; } }
2) If you still get the 'internal compiler error', then the issue is somewhere in the file. (you can try placing the CompileBreaker at the top, just to make sure) If not, then remove the CompileBreaker code from the file, and add it to the bottom of the next file.
3) Repeating steps 1 and 2 for each script file, in alphabetical order.
The first time I used this technique, (which was just a few minutes ago), I was pretty lucky. I found the cause of my 'internal compiler error' in the second file, "Core.cs". Which brings me to my next point, which is that...
Tip #2) The Mono compiler for Unity apparently has an issue with partial classes.
Here is the file I found to have caused the internal compiler error, with the error-causing line marked:
using System;
namespace ManagedLzma.LZMA.Master
{
public static partial class LZMA // <<< the line that caused the 'internal compiler error'
{
[System.Diagnostics.Conditional("SHOW_DEBUG_INFO")]
internal static void DebugPrint(string format, params object[] args)
{
System.Diagnostics.Debug.WriteLine(String.Format(format, args));
}
internal static void Print(string format, params object[] args)
{
System.Diagnostics.Debug.WriteLine(String.Format(format, args));
}
}
}
class CompileBreaker { int i = 0 / 0; } // my CompileBreaker code that wasn't reached
I removed the word "partial" from the line, and changed the class name to "LZMA_RenamedForNow", and the compiler successfully reached the CompileBreaker code at the bottom. I then moved the CompileBreaker code to the next file, found the same issue (with it having "partial" class declarations), and fixed it. Moved the CompileBreaker to the next file. And so on.
Each time the CompileBreaker code is reached, you know the code up to that point is fine, so you just move it to the bottom of the next file.
It's worked really well for helping me solve this sort of problem, that is otherwise almost pure guesswork. (before this I was trying to delete and comment out files and code blocks, but that became very difficult because the library with the issues has dozens of classes which are interlinked with each other--causing early, normal compile errors, that blocked my ability to see where the 'internal compiler error' was lying (since the 'internal compiler error' is only seen if it doesn't encounter normal errors first))
Anyway, hope this helps anyone still having issues with finding where their project's 'internal compiler errors' lie.
Answer by justinl · Nov 20, 2013 at 08:06 PM
It could be one of many things, but when this happens for me, I just change a line of a script and then when I go back to unity it forces things to re-compile and it usually works for me the second try. CTRL + R is also a way to force reload. I didn't see this mentioned as an advice in the comments.
Answer by crb471 · Jan 16, 2014 at 07:30 PM
I'm having the same issue with a different error message:
Unhandled Exception: System.UnauthorizedAccessException: Access to the path "C:\Users\Corey\Documents\RTStutorial\Temp\Assembly-CSharp.dll.mdb" is denied.
It'll happen with brand new projects - not an issue with the code. I tried re-installing Unity as Admin to no avail. Just started happening after 4.3 release.
For some people it's an antivirus issue, but even with McAffee deactivated I can't run my scripts. Major impediment to working, especially since I suck at coding to begin with.
Answer by Vectrex · May 30, 2014 at 12:46 PM
Check your 'yield' commands with IEnumerator coroutines. There's a bug I think in the mono compiler Unity uses. I had two in a branching if else statement. Each one on it's own worked, both didn't (even still inside the if statement). Might have something to do with normal return and yield return also.
Answer by Disastercake · Oct 11, 2014 at 06:11 AM
For myself it was because McAfee was installed. I replaced it with Norton and have not had problems since.
Your answer
Follow this Question
Related Questions
Warning messages are turning into Internal Compiler Errors...? 6 Answers
Another Internal Compiler Error 2 Answers
Internal Compiler Error again 1 Answer
Internal Compiler Error 0 Answers