XGouchet
XGouchet

Reputation: 10203

Xcode 4.5.2 errors are found but Build is marked as Succeeded

This problem is very similar to this one: Xcode 4 Preview 4 displays "Build Succeeded" but with errors

The different solutions proposed at the link doesn't work. I tried using product clean, deleteing the Derived Data, restart XCode and the Mac, but the problem still appears.

It seems that all the error are linked to the project's precompiled header : although the PCH is working fine and has no error in itself, the errors reported look like the pch is not found for this specific file. Also sometimes, while the build progresses, the errors appear and disappear randomly. Anyone have an idea on this?

enter image description here

The error only appear in the file(s) opened in the editor. If I close the file's in xcode but keep the project open, then no error are reported at all.

Upvotes: 30

Views: 6345

Answers (9)

Swati Gupta
Swati Gupta

Reputation: 364

Removing the last #import from .pch file, build the app then putting it back and building it again did the trick for me.

If you still see the errors then you could repeat this step for last two imports, last three imports and so on.

Upvotes: 0

mobility
mobility

Reputation: 37

Go to xcode install folder like below.

/Users/vinod/Library/Developer/Xcode

Step-1 Quit the xcode

Step-2 Delete the DerivedData Folder

Step-3 Now open the project and clean it all issue resolved.

Upvotes: 1

Zaid Pathan
Zaid Pathan

Reputation: 16820

  1. Delete derived data
  2. Clean project
  3. Quit Xcode and reopen it.

Upvotes: 0

superandrew
superandrew

Reputation: 1771

to add my two cents: my solution was to slightly change the order of imports in the pch file.

Maybe this is related to simply edit the file, but I've tried to "touch" it and edit and the only "thing" that did fix the problem was to move some import before others.

Upvotes: 0

Lance
Lance

Reputation: 9012

Have you tried cleaning the build folder?

In XCode, open the Product menu then hold down option. Clean should change to Clean Build Folder.

Edit:

You can also press + + + K

Upvotes: 27

Mustafa
Mustafa

Reputation: 5347

Cleaning the product folder and restarting didn't help me. I started seeing this after I deleted the DerivedData folder. I was able to "fix" by doing :

  1. Clean build.
  2. Archive
  3. Build

Upvotes: 2

kball
kball

Reputation: 4971

Cleaning, closing, restarting - none worked for me.

A simple touch/edit to the pch file in question resolved the issue.

Upvotes: 68

hatunike
hatunike

Reputation: 1977

I had this same issue, and neither types of cleans helped. I also tried deleting the build folder, restarting xcode, etc and for me what finally solved the issue was to remove the files that the errors referenced and re-add them.

Additionally, I investigated the error after the fact, and the issue seems to be XCode's "Show Live Issues" feature. (This can be unchecked in the preferences, this also solved the issue but was unsatisfactory as a solution as I've grown to enjoy xcode's live code sense.)

Upvotes: 5

Bill Burgess
Bill Burgess

Reputation: 14154

I'm not sure adding a define to the pch will work as you think. Try creating a Constants header and add your defines there. Then you can include the import statement in your pch file and it should work that way.

Upvotes: 1

Related Questions