可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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?
回答1:
Open a terminal and type in :
rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache/*
Clean your project and build again. Worked for me.
回答2:
Delete the folder, clean the app, restart Xcode if necessary.
回答3:
as per xcode 5.
- click on Xcode preferences
- Goto locations tab
- click on the derived data path which navigates to the folder called
DerivedData
- Delete the whole folder and restart xcode.
This works fine for me.
Happy coding :)
回答4:
Have you tried reinstalling xcode? And have you cleaned using cmd+shift+k ?
回答5:
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.
回答6:
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
回答7:
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.
回答8:
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 :)
回答9:
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
回答10:
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 !!!
回答11:
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
回答12:
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.
回答13:
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.
回答14:
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