7

Xcode 4 Preview 4 displays "Build Succeeded", as show the image below there are 5 erros. Actually there are more than 5 errors, but it seems that Xcode doesn't build anymore. It happened when i built the project in xcode 3 while the xcode 4 was open with the same project. Anyone have an idea to overcome this bug and reestablish the Xcode??

alt text

I tried to restart the Xcode, restart the mac. I don't know how to clean up the build. The "clean all" option in Product menu is unable.

Thanks in advance.

idmean
  • 14,540
  • 9
  • 54
  • 83
joaocarlospf
  • 1,129
  • 2
  • 13
  • 23
  • 4
    Xcode 4 is still under NDA; take this to http://devforums.apple.com/ – bbum Dec 05 '10 at 19:30
  • Do not discuss products under NDA on Stack Overflow. – Shaggy Frog Dec 05 '10 at 21:17
  • 2
    @Shaggy Frog: While I agree that this is probably going to get a better answer elsewhere, any NDA you signed is between you and Apple. If people want to ask here, they're free to do so. – Bill the Lizard Dec 05 '10 at 22:46
  • Also, as this is about a beta product, I'd suggest that this be closed as too localized. Odds are, behavior will be different in the next build and certainly by the time of final release. – Brad Larson Dec 05 '10 at 23:53
  • @Bill the Lizard I'm not sure Stack Overflow wants to condone breaking of NDAs, especially in this case, where there is an NDA-safe forum already available as bbum has referenced. In business terms, you're voluntarily introducing risk to the website. – Shaggy Frog Dec 06 '10 at 00:58
  • @Shaggy Frog: The risk isn't to the web site, it's to anyone who breaks the NDA. I do agree that questions like these should be taken to the NDA-safe forum though, since that's where they're much more likely to be answered correctly. – Bill the Lizard Dec 06 '10 at 01:49
  • @Bill the Lizard I think you're honestly being a bit naive, especially given Apple's history of litigation surrounding matters of IP protection. There is most certainly risk to the website proper. Ask yourself: what is the upside to supporting questions regarding technology you *know* to be under NDA? Then ask yourself: what are the potential downsides? Is it worth risking legal action just to let people post questions for beta software, questions which are unlikely to be relevant after a final release? – Shaggy Frog Dec 06 '10 at 06:27
  • 4
    @Shaggy: The only people who are bound by an NDA are the people who agree to it. I don't have a problem with you reminding people that something is under NDA and linking to Apple's dev forums. I do have a problem with you telling people not to discuss programming related topics on Stack Overflow. Until Jeff and Joel decide otherwise, I'm not going to be enforcing 3rd party NDAs. – Bill the Lizard Dec 06 '10 at 12:13
  • Well this problem remains in XCode 4.3 also.. – Krishnabhadra Jun 01 '12 at 08:15

4 Answers4

4

Follow these steps:

  1. Edit your PCH file
  2. Save it again.
  3. Clean and build
  4. No 4th step.

Hope it helps!

NeverHopeless
  • 11,077
  • 4
  • 35
  • 56
2

Try going into your Build directory and simply deleting everything.

For Xcode 3, the build directory is usually located inside your main project folder. For xcode 4, as discussed in this question, can be found, by default, in ~/Library/Developer/Xcode/DerivedData.

Also, be aware that you won't be able to clean a target if it's running inside the simulator (though it seems like that doesn't apply in this case.)

Community
  • 1
  • 1
Sam Ritchie
  • 10,988
  • 4
  • 42
  • 53
  • Unfortunately it's still the same. After deleting the build folder, xcode 4 doesn't recreate the build folder. Xcode3 does it normally. – joaocarlospf Dec 05 '10 at 19:21
  • just updated my answer to show where the build directory is for xcode 4 vs xcode 3. What do you think of xcode 4, by the way? Worth switching, in its current state? – Sam Ritchie Dec 05 '10 at 19:28
  • 1
    XCode (4.5.2) has been out of beta for a while now, but the behaviour persists... the errors are only in the selected file by the way, which is even stranger. If I select a file, errors pop up in it. So, it has something to do with autocompletion or auto evaluation of something. When the build is done, the auto evaluator of the editor kicks in again and it suddenly spots errors... but why? Anyone come up with a solution? It seems xcode loses some #imports or source paths after compiling. – Joris van Liempd iDeveloper Dec 07 '12 at 10:58
1

I just got this error today and want to explain what I did in case anyone else encounters it.

Xcode would display errors but the build would be successful and run in Simulator. I created a new project from scratch and the same thing happened. I'd insert random lines like "saedrw34" and it would highlight it with the red exclamation point. But the code would still build and run.

Check the autosave settings: Xcode-->Preferences-->General: Auto-save --> Set to Always.

I remembered that prior to my problems I had changed it to "Never." I didn't realize Xcode, when you hit Run, compiles the latest saved version on your hard drive, not the current version you see on the screen. So basically, it was building a different version than the one with errors.

May be different from your situation but thought I'd just pass it along..

idmean
  • 14,540
  • 9
  • 54
  • 83
Triad
  • 11
  • 1
-1

For me the following worked:

  1. Got to the "File Inspector" and uncheck the targets under "Target Membership"
  2. Build the project (maybe also clean build)
  3. Check the unchecked targets under "Target Membership"
  4. Build the project
Qbyte
  • 12,753
  • 4
  • 41
  • 57