How to solve the apple LLVM 5.0 error in xcode 5?

2019-06-24 00:12发布

问题:

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.

回答1:

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.



回答2:

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



回答3:

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.



回答4:

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


回答5:

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



回答6:

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.