4

I was running my application without any problems on both the simulator and device. All of a sudden i get this error:

fatal error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionView.h' has been modified since the precompiled header '/Users/rashidasgari/Library/Developer/Xcode/DerivedData/ModuleCache/SWBH8ZAWBXAH/UIKit.pcm' was built note: after modifying system headers, please delete the module cache at '/Users/rashidasgari/Library/Developer/Xcode/DerivedData/ModuleCache/SWBH8ZAWBXAH' 

I tried any solution i could find and still no luck. Note that i tried running the application on another MacBook and everything works fine without any errors.

2
  • By the way i could not find the '/Users/rashidasgari/Library/Developer/Xcode/DerivedData/ folder. i would be happy if someone could tell me how to find this folder. Commented Oct 20, 2013 at 14:09
  • CMD+SHIFT+G paste the path. The Library folder is invisible Commented Oct 20, 2013 at 15:07

6 Answers 6

24

Cleaning the project is the first port of call (menu under Product).

If that doesn't help, delete the derived data. That can be done via the Locations section of the preferences or by navigating to the directory in Finder and deleting it (there is a little -> button in preferences to get there, or use Go To Folder... option in the Finder.

Sign up to request clarification or add additional context in comments.

2 Comments

It still doesn't work for me after doing all this :( Xcode 5.0.2
Note that you need to delete "DerivedData" folder or just rename it.
2

Ok after trying almost every solution on web, i decided to reinstall xcode and it finally worked.

Comments

2

I solved this problem by changing DerivedData folder name..see how i did

Xcode->preferences->Then you will be redirected to preferences screen

Then click on locations tab under menu selection->then you will have options like Derived data,snap shots ,archives

under Derived data you can see some thing like /Users/SENABI/Library/Developer/Xcode/DerivedData-> then click on that arrow button that's it there you can see DerivedData folder click on that and rename it. your error will be removed. This is my experience and it worked for me hope it will be helpful to someone.

1 Comment

You should better delete Derived data than renaming it, b/c when you rename it, xcode has no access to it. So renaming and keeping it the folder in system for nothing makes no sense. Though your answer was helpful, I didn't know this xcode->preferences-> path
1

Error occurs when system header files are modified.

Solution :

  • If you have the backup of XCode then reinstall the XCode (Better solution).
  • Delete the DerivedData folder and then build the project

Comments

0

Use CMD+Shift+K to clean the build and then relaunch. This should solve the issue.

2 Comments

That's strange... I ran into the same issue and it always work that way. You may want to delete the derived data then.
Actually i did and that did not work either! The only way to solve this was reinstalling xcode. Thanks anyway.
0

you don't have to delete anything. you messed up a git pull somewhere probably. just quit Xcode and the simulator, reset any changes (or stash them) try another git pull, start Xcode again, clean your project and run it again.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.