18

Checked all of the question shown in image but nothing works out. enter image description here

In xcode 5 I m getting this issue

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

What could be the issue??? Any help ld be greatly appreciated.

Rajesh
  • 10,318
  • 16
  • 44
  • 64

5 Answers5

40
  1. Delete DerivedData at /Library/Developer/Xcode/DerivedData/
  2. Reset your simulator

Quit xcode and then it runs again.

hgwhittle
  • 9,316
  • 6
  • 48
  • 60
ChandreshKanetiya
  • 2,414
  • 5
  • 27
  • 41
  • Thank ChandreshKanetiya you are the MAN! If I Had a Double vote I'd Give it to you :-) Also, My Xcode/DerivedData folder was in another Location, just worth Mentioning ;-) – Hernan Arber Jul 27 '14 at 09:13
  • wasted time on this issue. Thanks for pointing out this simple fix man. – shah1988 Aug 21 '14 at 14:09
  • Brilliant answer!! Those looking to delete derived data check the correct and equally brilliant answer at http://stackoverflow.com/questions/18933321/deleting-contents-from-xcode-derived-data-folder – holierthanthou84 Sep 10 '14 at 09:18
  • 4
    Worked great! Thanks. One change though. The derived data directory is at `~/Library/Developer/Xcode/DerivedData/` – Mr Rogers Sep 10 '14 at 21:32
  • 6
    You only need to delete the `DerivedData/ModuleCache` folder. – Rivera Sep 19 '14 at 05:02
  • I was only deleting the project file inside DerivedData. When I deleted both DerivedData/MyProject-ert3f34 AND DerivedData/ModuleCache everything worked. Thanks. – AndroC Oct 31 '14 at 14:28
  • 1
    You only need to delete the ```DerivedData/ModuleCache/YOUR_PROJECT_CACHE``` folder. – chunkyguy Jan 21 '15 at 05:01
  • I had same issue on simulator and device(iPad). Deleting the DerivedData/ModuleCache worked for me. Thanks Rivera Sep – Shanmugaraja G Mar 15 '15 at 13:24
14

Deep clean (Cmd + Opt + Shft + K), clearing folder DerivedData, clearing simulator, restarting Xcode and mac doesn't work for me.

Problem was fixed only after changing pch-file (adding a whitespace or comment/uncomment some code). File was incorrectly cached on build phase by Xcode. Changing this file fixed problem.

KepPM
  • 1,129
  • 7
  • 17
5

It is a very common problem if you are dealing with library development.I would suggest you to set Precompile Prefix Header to NO. Nothing worked for me except this.

Carrie Kendall
  • 11,124
  • 5
  • 61
  • 81
deepax11
  • 199
  • 3
  • 7
1

If the other mentioned solutions don't work for you, here's what works for me.

  1. Go to the folder that contains the mentioned simulator in the error message. In my case it was: Xcode > Contents > Developer > Platforms > iPhoneSimulator.platform > Developer > SDKs Then delete the simulator/s in that folder.

  2. Go to Xcodes preferences > downloads > and hit "check and install" to get your simulators back.

  3. Do a clean, and delete derived data.

I found that this error occurs mostly when I'm working in interface builder and have the assistant editor set to automatic. Sometimes the auto file will be something like NSObject, and if you accidentally edit that, you will get this error.

Alternatively, if you have time machine set up, you can restore the offending file.

Beau Nouvelle
  • 6,962
  • 3
  • 39
  • 54
1

If above not worked try delete precompiled header folders in /var/folders/d4/pz....00gq/C/com.apple.DeveloperTools/6.0.1-6A317/Xcode/SharedPrecompiledHeaders/your app change the path according to your machine and find the precompiled header folders then delete and run again.