Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - File not found but build successful

In my project, I've include a full "shared" folder by link (not copy) that is outside my project folder.

In the .pch file, I have #import "MyStandardHeader.h"

My Build settings does not have any search path to the "shared" folder.

In the "MyStandardHeader.h", I have #import "NSMutableArrayCustom.h" that is inside a subfolder of "shared".

I use in my code a NSMutableArrayCustom class.

I never include NSMutableArrayCustom.h

I've clean the project, quitted XCode, launched it again, build, run on both iPhone and simulator : everything works fine, but I have a red compile error: MyStandardHeader.h - No such file or directory

I've tried in the build settings Always search user pathat YES and NO, it's the same.

What is the problem? Why do I have this error? How make it disappear?

like image 520
Oliver Avatar asked Apr 06 '11 23:04

Oliver


2 Answers

I've seen this too: files that clearly exist get wonky. Oddly, sometimes it fixes itself. It may be an Xcode bug, since the build always succeeds. I've had success with touching the file. sometimes a clean helps. and sometimes quitting xcode helps.... Voodoo really.

You could try to remove the index by deleting everything in ~/Library/Developer/Xcode/DerivedData

That directory is a combined version of the old Build and Intermediates directories from Xcode 1,2 and 3. Basically it's all the temporary and generated files from your project: object files, indexes, etc.

like image 78
amattn Avatar answered Oct 22 '22 18:10

amattn


I tried the steps mentioned above, but to fix the error I had to remove the file from "Copy Bundle Resources" in the project "Build Phases".

like image 29
patrick-fitzgerald Avatar answered Oct 22 '22 19:10

patrick-fitzgerald