Xcode compilation (fatal) error - ios

I upgraded my system to OS X Yosemite and now I'm getting this error when I try and build my iOS projects:
fatal error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/usr/include/sysexits.h' has been modified since the precompiled header '/Users/sidatre/Library/Developer/Xcode/DerivedData/Project_Chow-dlqpzktxazigviayrdmdiwvrvitj/Build/Intermediates/PrecompiledHeaders/Project Chow-Prefix-eswczkpscchtlodgkuyyxqdzoayy/Project Chow-Prefix.pch.pch' was built
Any insights?

Do a clean build. This will remove the precompiled header.

2 things,
Go to product->clean in the top bar, this will.. Well... Clean it up, sometimes it won't work in your case so
Compile it again, if it's been modified after compiling it.
If this still does not work, then try saving it, then compile it, if it still does not work (which is a bit unlikely) then try going to that exact fault file, just a warning this is a bit risky, so make a backup btw, see what's in it; if you think it's important, see if there is any way of editing it indirectly on Xcode (by writing code), if not then try deleting it then make it again with the same text, just do it yourself. I wouldn't recommend deleting it, but if it is still not working that may be your only option.
I hope this helps.

Related

Many files "missing from working copy" in Release-iphonesimulator

I'm having trouble with a whole bunch of warnings about missing files since upgrading to Swift 3 in Xcode 8.1. I've attached an image with a sample of the errors. There are about 40 of them in total.
All refer to files missing from MyApp/build/MyApp.build/Release-iphonesimulator/MyApp.build/Objects-normal/x86-64/.... None of them are files which I would not have touched or edited.
I have cleaned and rebuilt, cleaned build folder, deleted all derived data, and a few other things, all with no luck. The app compiles and runs, but has this stack of warnings I can't get rid of.
I also double checked my Release Search Path in Build Settings. Here is what I have it set to:
These have me stumped. Any suggestions appreciated.
I finally solved this. It WAS version control related. I had tried committing and resetting status, with no luck. However, when I tried a Pull, it said I had uncommitted changes, even though I had just committed. Therefore, I tried Discard All Changes, and that solved it. Did a clean and build and the warnings are now gone.

Xcode 7 crash every time I try to print something in the debugger console

I've searched around and can't find anything on this.
Using Swift 2 and Xcode Version 7.0.1 (7A1001). Every time I execute something in the debugger console, Xcode crashes.
The project is not very big, and has less than 10 third party frameworks.
I can't think of much more information that's relevant, but I'm sure there's more, so please do ask me if there's anything I should add to my question that would help.
I've of course cleaned build and derived data.
It's driving me insane. Thanks!
UPDATE 16/11/12
Submitted rdar://23559366.
How are you maintaining your third party frameworks? Via Carthage?
If so then this is probably your issue: https://github.com/Carthage/Carthage/issues/924
This is an issue if the location of the /Carthage/Build/iOS folder is in a different location to where it was produced (i.e if it was compiled on a different machine and the absolute file path has changed).
A temporary fix would be to run carthage build --no-use-binaries on your machine to rebuild the symbols using the current absolute file path working around the bug.
But if you wasn't using carthage then its probably not your issue so sorry
I had similar problem with Xcode whenever I hit breakpoint.
In case you see this screen right before your Xcode crashes - you are lucky and my fix might save you. All you need to do is open this window and in the Project Navigator, select any file that you want, so that instead of that white blank view you would get your code. After this you are most likely will be able to successfully stop your app at your breakpoint and perform the debug.
I am not sure why this happens, but I suspect that the reason is Debug View Hierarchy mode, which you might have triggered prior to setting you breakpoint and trying to stop at it. At least this is when it happens to me.
I have similar problem earlier.
If you try to print non-optional variable and unfortunately it holds nil value then it breaks/crash. so that make sure declare all possible variables as "Optional type".

Xcode 6.3 always does full rebuild of Swift project

One of the long anticipated features of Swift 1.2/Xcode 6.3 is incremental builds. They worked fine for me until recently, but now almost every time I change even a single line of code it does full rebuild.
I tried restarting Xcode, computer, cleaning derived data, but to no avail. Googling doesn't seem to reveal anything.
Does anyone else have this problem? How do I fix it?
I think that this is what you searching for
I am not this is a source of the problem. According to https://developer.apple.com
Swift Performance
A new compilation mode has been introduced for Swift called Whole Module Optimization. This option optimizes all of the files in a target together and enables better performance (at the cost of increased compile time). The new flag can be enabled in Xcode using the “Whole Module Optimization” build setting or by using the swiftc command line tool with the flag -whole-module-optimization. (18603795)

Xcode Pinterest.h file not found

So I have looked high and low for a fix for this and nothing seems to work. I have a a project that works 100%, but when I transfer it over to another mac I get the following error. Pinterest.h file not found. However this file is in fact present and makes no sense why I am getting this error. I have tried cleaning build, cleaning build folder, restarting xcode, checking build paths and I simply cannot figure out this issue. Here is an image of the error
and here is an image of the class that is causing the error
Literally any help on this would be amazing, I am using sharekit if that helps at all.
Are you sure you have Pinterest.h included in the actual project? It could be that, on your second device, you forgot to include the Pinterest.h as a file inside the project itself. It might be within the directory structure, but that doesn't mean that it's included in the Xcode project.
With the limited images you provided, it's really hard to tell one way or the other. Can you provide more information/images?

Xcode Won't Parse Files to Find Errors

I have a strange issue that I haven't seen or read about anywhere else. My Xcode no longer parses all of my files to find issues/errors. It will display any issues or errors in a file I am currently viewing, and these will persist thereafter, but with 400+ files I can't reasonably visit each one to make it compile. Xcode can build successfully if the code is valid, however I can never know when that is, since I see no errors. Indexing occurs, but no compiling takes place.
Also, when building, the status bar states that Xcode is compiling x out of however many total compile sources but the total number is usually not even close to the actual total number. For example it may say compiling x out of 40 files when there are actually 400 compile sources.
I wasn't doing anything out of the ordinary from my usual tasks when this issue began. New projects will compile, then randomly stop compiling after a period of time.
Things I have tried:
nuking derived data
quitting Xcode/restarting computer
Recloning the project from a known working repository. It will build but won't find errors/issues when they do exist. There should be at least a handful of minor issues but none appear.
Reinstalling Xcode (4.5.2)
tried both GCC 4.2 and LLVM 4.1 compilers
Has anyone experienced this issue before and found a solution? This problem has made my job extremely difficult and any help would be much appreciated.
It does sound like corruption of DerivedData. Try this:
Clean your target: cmd+shift+K or Product->Clean
Quit xcode
Delete the contents of /Users/your_user/Library/Developer/Xcode/DerivedData
Restart xcode
(It's safe to delete this folder's contents. But if you're nervous about that, back it up first).
You should be good to go.

Resources