Xcode build and clean fails without errors

After getting random errors from xcode, I was reading stackoverflow and instead of deleting the derived folder for an error code 1, i believe it was, I think I accidently deleted a file called swiftc.


Any project I try and clean or run on xcode fails without errors. I've tried multiple projects all failing the same way. I even reinstalled xcode without any luck in resolving the error.


I'm completely stuck and dont know what to do. Times like these I wish I had my time machine setup...


I also just noticed that my products app is red... what does that mean...

Why would someone delete this thread and all the comments in it. I was trying to fix my weird issue, but that's cool too.

(I dunno what happened. Here's the last reply I posted.)


It is extremely odd. On my installation, the file at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc is actually a symbolic link to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift, which is a real executable in the same folder. It makes no sense that there should be error messages that make "swiftc" look like a directory.


At this point, you probably have nothing to lose by re-creating the symbolic link manually, if you can (or restore it from a backup). The permissions look like this:


lrwxr-xr-x 1 root wheel 5 Sep 19 20:46 swiftc -> swift


Did you delete Xcode before you re-installed it? Did you re-download from the Mac App Store? (A store download may actually download a delta rather than the whole thing, which might make a difference.)


If nothing else, I suggest you try calling Apple's Developer Program Support. It shouldn't be this hard to re-install an Xcode that … you know … works, so it seems reasonable for Support to take a look at the problem.

Thank you for continuing on.


I dont know what this is or how i should use it. How would I use this to recreate the link?

lrwxr-xr-x  1 root  wheel         5 Sep 19 20:46 swiftc -> swift


I did delete xcode before I reinstalled. Where would I download xcode from if not from the app store?


I'll call as a last resort but its good to keep that in mind.

You can recreate the symbolic link in Terminal, and do things like change permissions, but I'm not enough of an expert to try guiding you through command line things, if you're not familiar with them. No backup to restore from?


You can download Xcode directly from here:


https://developer.apple.com/download/more/


It's near the top of the list.

You have been really helpfull. Hopefully this new download fixes it. Not sure why it would work on one account and not the other. So here goes nothing.


Thanks again.

>Any project I try and clean or run on xcode fails without errors.


A simple clean is rarely useful (and now removed when using 'new build system). Instead, use Xcode's Product menu, then, with the option key pressed, select 'Clean Build Folder'. However... it now appears there is a CBF (also C?) bug w/9.2… Just found this in the Xcode v9.3 beta release notes:

“Fixed an issue in which the Clean Build Folder command could fail to complete."

Xcode build and clean fails without errors
 
 
Q