Aeveus
Aeveus

Reputation: 5382

Can't get rid of Apple LLVM 5.0 Error

It keeps saying:

fatal error: file '/Applications/Xcode5-DP5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/objc/NSObject.h'

has been modified since the precompiled header

'/Users/jackiexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P/ObjectiveC.pcm' was built

note: after modifying system headers, please delete the module cache at '/Users/jackiexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P'

1 error generated.

I must have deleted the derived data at least five times by now, and I'm getting nowhere. Any ideas?

Upvotes: 41

Views: 18011

Answers (14)

Yunus Nedim Mehel
Yunus Nedim Mehel

Reputation: 12389

The same thing was occuring to me. The warning was telling me:

After modifying system headers, please delete the module cache at '/Users/yunus.mehel/Library/Developer/Xcode/DerivedData/ModuleCache/13XL2DHZVON89'

So, I have restarted xcode, deleted derived data from Organizer, deleted derived data from the derivedData folder; none of them worked. Then I have realized, the solution was already there; go to:

"DerivedData/ModuleCache/13XL6DH2BON89"

and delete that folder, not the "DerivedData/<your_project>". Make a clean build, it will work again.

Upvotes: 6

orkoden
orkoden

Reputation: 20006

Run this script to delete all relevant files in /Library/Developer/Xcode/DerivedData and /var/folders:

# run with
# ruby reallyCleanXcode.rb
derivedDataFolder = Dir.glob(Dir.home + "/Library/Developer/Xcode/DerivedData/*")
moduleCache = Dir.glob("/var/folders/**/com.apple.DeveloperTools*")
FileUtils.rm_rf derivedDataFolder + moduleCache

Upvotes: 4

Zubin Piya
Zubin Piya

Reputation: 1

I was facing the same issue. I first cleaned the project do this by hitting "shift + command + k" and just rebuilt the project and it worked for me. hit "command + B" to rebuilt your project

Upvotes: 0

Saif Ali Khan
Saif Ali Khan

Reputation: 1

I used Shift + CMD + K to try and clean the project, but it did not disappear.

All I had to do was go and check the names of <yourProjectName>-info.plist and <yourProjectName>-Prefix.pch.

Then Shift + CMD + K worked.

In my case the problem was Clang exiting with code 1.

Upvotes: 0

Olie
Olie

Reputation: 24685

In addition to all of the other "clean your build" answers, nothing was working for me until I emptied out the (highly undocumented!) /var/folders directory.

Apparently, this is a "miscellaneous caches" dir maintained by OS-X. I didn't even bother figuring out what were "the correct files"; I just cleaned out the entire directory.

...And now I can build again. Hooray! From terminal:

[sudo] rm -rf /var/folders/*

(Although I did it from Finder, via authentication.) (OS-X 10.9.latest)

Additional clue: I could build with XCode-6-beta, but got the goofy corrupt error in XCode-5.

Upvotes: 0

andrewchan2022
andrewchan2022

Reputation: 5310

my solution,

in terminal, run command:

rm -rf /Users/jackiexu/Library/Developer/Xcode/DerivedData/ModuleCache/2MWVPCGUMQ29P

then in xcode, clean then restart xcode and build

Upvotes: 0

Neva
Neva

Reputation: 1330

Open a terminal and type in : rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache/*

Clean your project and build again. Worked for me.

Upvotes: 61

Van Du Tran
Van Du Tran

Reputation: 6892

I solved this by:

Quit restart Xcode + clean project + clean build folders + clean derived data + deleted the /var/folders/.../.../C/com.apple.DeveloperTools/5.0.2-5A3005/Xcode/SharedPrecompiledHeaders + unplugged my iPhone

Rebuild and works :)

Upvotes: 1

Dipak Narigara
Dipak Narigara

Reputation: 1806

Please follow below steps to get rid from your problem.

"Library/Developer/Xcode/DerivedData/ModuleCache/"

Delete all Folders inside ModuleCache Folder.

Make a clean build, quit Xcode and run it again

sure ,it will work fine.

Good Luck !!!

Upvotes: 0

Abhilash Reddy Kallepu
Abhilash Reddy Kallepu

Reputation: 584

as per xcode 5.

  1. click on Xcode preferences
  2. Goto locations tab
  3. click on the derived data path which navigates to the folder called DerivedData
  4. Delete the whole folder and restart xcode.

This works fine for me.

Happy coding :)

Upvotes: 12

ASK
ASK

Reputation: 11

I was having the same problem. I did SHFT+CMD+K and tried to run,again the error appeared. My error pointed to the NSJSONSerialization header file. So what I did is deleted the files in ModuleCache and the project seems working now. I had changed my code which used NSJSonSerialization thinking it to be wrong, and project started working with the code also :)

To delete the files -- Click on 'Go' in the Desktop and then 'Go to folder' then type the folder path (Eg : 'Library/.…./ModuleCache') and delete all the files.

Regards, ASK

Upvotes: 0

Sophy Swicz
Sophy Swicz

Reputation: 1367

This happen when compiling, when running the app or neither?

Have you tried this:

Build Settings - Build Locations - Precompiled Header Cache Path -- there's a folder... delete it.

Upvotes: 2

Arbitur
Arbitur

Reputation: 39091

Have you tried reinstalling xcode? And have you cleaned using cmd+shift+k ?

Upvotes: 6

coneybeare
coneybeare

Reputation: 33101

Delete the folder, clean the app, restart Xcode if necessary.

Upvotes: 16

Related Questions