Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recurring error on xcode 5: file .h has been modified since the precompiled header .pcm was built

This is the error I get:

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

So the problem is that these system .h files(ALAssetRepresentation.h in this error) get modified(not by me, at least not knowingly), I see in the finder that their modified date has been changed, and the only way to solve it is to copy them from another my old xcode directory(xcode4), as it still preserves the old modified date.

Does anyone have a hint on why these files get modified and how to prevent it? I can change them to read only but I fear that this change might just screw things even more(having a write permissions seems to the default, I've checked with other people's installations).

Thanks

like image 835
Eytan Levit Avatar asked Oct 28 '13 08:10

Eytan Levit


3 Answers

I had this problem once. Got to your derived data folder and remove everything in it. and dont worry, the system can recreate everything in this folder

like image 127
Nicolas Manzini Avatar answered Sep 23 '22 05:09

Nicolas Manzini


Remove the pcm file

rm "/Users/user/Library/Developer/Xcode/DerivedData/ModuleCache/16ZE17LEJCX4P/AssetsLibrary.pcm"

then

Clean Project( Cmd+Shift+K)

Problem solved

like image 38
khanghoang Avatar answered Sep 23 '22 05:09

khanghoang


If you look at the Error closely, it comes with the warning, as mentioned in question as well:

After changing system header you should remove moduler cache, which resides path (in my case) /Users/developer/Library/Developer/Xcode/DerivedData/ModuleCache/2IPA3N5W2OEZW

What I did, (I went to extreme)

  • Removed everything inside this folder. Then ran the project it had 2 errors.
  • Then deep clean my code with option + command + shift + k

Now i was good to go. Code exicuted properly and result produced.

like image 23
rptwsthi Avatar answered Sep 19 '22 05:09

rptwsthi