GCC failing on UnityScript.dll.o in Xcode 4.1

I haven’t had problems building with Unity in the past, but recently upgraded to Xcode 4.1, my certificate, profile, etc all seems in order. I’m deploying to 4.0 with SDK set to “Latest iOS (4.3)” but am getting build failed with one error, the very unhelpful and generic “Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1”

the complete error text is here:

CompileC /Users/will/Library/Developer/Xcode/DerivedData/Unity-iPhone-chrlngxtgyfyqkhgtglcflxmolet/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/Assembly-UnityScript.dll.o Libraries/Assembly-UnityScript.dll.s normal armv7 assembler-with-cpp com.apple.compilers.llvmgcc42
    cd "/Users/will/Desktop/2Driver iOS Project"
    setenv LANG en_US.US-ASCII
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -x assembler-with-cpp -arch armv7 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -Os -Wreturn-type -Wunused-variable -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk -fvisibility=hidden -mno-thumb -miphoneos-version-min=4.0 -iquote /Users/will/Library/Developer/Xcode/DerivedData/Unity-iPhone-chrlngxtgyfyqkhgtglcflxmolet/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/2driver-generated-files.hmap -I/Users/will/Library/Developer/Xcode/DerivedData/Unity-iPhone-chrlngxtgyfyqkhgtglcflxmolet/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/2driver-own-target-headers.hmap -I/Users/will/Library/Developer/Xcode/DerivedData/Unity-iPhone-chrlngxtgyfyqkhgtglcflxmolet/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/2driver-all-target-headers.hmap -iquote /Users/will/Library/Developer/Xcode/DerivedData/Unity-iPhone-chrlngxtgyfyqkhgtglcflxmolet/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/2driver-project-headers.hmap -I/Users/will/Library/Developer/Xcode/DerivedData/Unity-iPhone-chrlngxtgyfyqkhgtglcflxmolet/Build/Products/include -I/Users/will/Library/Developer/Xcode/DerivedData/Unity-iPhone-chrlngxtgyfyqkhgtglcflxmolet/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/DerivedSources/armv7 -I/Users/will/Library/Developer/Xcode/DerivedData/Unity-iPhone-chrlngxtgyfyqkhgtglcflxmolet/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/DerivedSources -F/Users/will/Library/Developer/Xcode/DerivedData/Unity-iPhone-chrlngxtgyfyqkhgtglcflxmolet/Build/Products -c "/Users/will/Desktop/2Driver iOS Project/Libraries/Assembly-UnityScript.dll.s" -o /Users/will/Library/Developer/Xcode/DerivedData/Unity-iPhone-chrlngxtgyfyqkhgtglcflxmolet/Build/Intermediates/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/armv7/Assembly-UnityScript.dll.o

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

So it errors while compiling Assembly-UnityScript.dll.o, but doesn’t tell me anything more.
I’ve tried cleaning, recreating from Unity, deleting and recreating my distribution profile, etc.
Has anyone had experience with this or know how I could go about fixing it?
Thank you.

This was a really painful Error for me.

It turned out the error was simply caused by the fact I had a number in one of my script names. At first I thought it was a name conflict or something (3DLevelObject.js) but after some testing it seemed to be just the “3” part (not sure if it’s the same with other numbers).

I had no idea that this kind of problem existed (would be nice if the editor threw a warning or error about it). Or maybe it’s just a weird problem specific to my build pipeline?

Hope this fixes your problem!

So weird… Taking numbers out of my scripts fixed the problem for me too. Thanks a lot!!

LOL, for anyone that was a programmer before Unity IDEs review legal variable and class naming in C C++. They can’t begin with a number and I believe Unity Editor when it derives classes it uses it does so from the name of your script to do that. System variables follow different rules, …

I got the similar error message from the Unity editor but in a different way.