Cross compilation failed - CSharp.dll

I’m trying to compile a project to iOS in unity 4.1.2f1, and getting the same error every time during the process. Anyone know how to fix this, or even what it means?

Cross compilation job Assembly-CSharp.dll failed.
UnityEngine.UnityException: Failed AOT cross compiler: /Applications/Unity/Unity.app/Contents/BuildTargetTools/iPhonePlayer/mono-xcompiler --debug --optimize=-linears --aot=full,asmonly,write-symbols,soft-debug,static,outfile=“Assembly-CSharp.dll.s” “Assembly-CSharp.dll” current dir : /Users/si12/Desktop/structure_demo_11_iOS/Temp/StagingArea/Data/Managed
result file exists: True
stdout:
stderr:

at UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultingFile) [0x00000] in :0
at UnityEditor.MonoCrossCompile.CrossCompileAOT (BuildTarget target, System.String crossCompilerAbsolutePath, System.String assembliesAbsoluteDirectory, CrossCompileOptions crossCompileOptions, System.String input, System.String output, System.String additionalOptions) [0x00000] in :0
at UnityEditor.MonoCrossCompile+JobCompileAOT.ThreadPoolCallback (System.Object threadContext) [0x00000] in :0
UnityEditor.HostView:OnGUI()

I don’t know how to fix, but I can tell you what it all means. Your script code that you write gets dropped into assemblies. Your c# code ends up in an assembly called Assembly-CSharp.dll. This assembly contains byte code. On iOS Apple do not allow Mono to run, so instead, the byte code (your scripts) are cross-compiled into Arm assembler. The first line you provide in your question is Unity saying that this phase of the build has failed. The second line is really just a simple stack trace that tells you how Unity got to this point. It’s not actually that helpful.

You might want to experiment with your script codes. Try and remove some of the script code from the build. See if you can identify a c# file that causes the problem. It might be that just one script file is causing a problem. If you can locate such a file, then send a bug report using the bug reporter tool, and include the file. If you can identify the cause, then try rewriting the script file so you use different bits of c#. My guess is that there is some byte code in your assembly that Unity doesn’t know how to convert into assembler. (I might be wrong, of course.)

Yep this worked for me - traced the problem a redundant C# script with a bug in it. Removed and complier worked fine.