file has been modified since the precompiled header was built
Asked Answered
E

13

44

So I accidentally modified a header (CBCentralManager.h) and caused the above error to show when I build. I searched stack overflow for the solution, and found this. Even after deleting the derived data, I still get the same error. I've also tried to delete the ModuleCache/FUW5IOHP9BIS folder with no success.

Here is the specific error I'm seeing:

file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBCentralManager.h' has been modified since the precompiled header '/var/folders/pj/hslm53_51xxd_npfqym5r6z00000gn/C/com.apple.DeveloperTools/5.0-5A1412/Xcode/5.0-5A1412/Xcode/ModuleCache/FUW5IOHP9BIS/CoreBluetooth.pcm was built

Any help is greatly appreciated.

Evanston answered 15/10, 2013 at 21:51 Comment(4)
have you tried clean and rebuild from xcode's menu?Inquietude
Yes, I've tried everything in the link in the question. It doesn't make sense that clearing the derived data does not fix this problem.Evanston
Possible duplicate of #14793829Katzenjammer
Try this... https://mcmap.net/q/275366/-fixing-file-39-project-pch-39-has-been-modified-since-the-precompiled-header-was-built-error-in-xcode Worked fine for me.Rostov
I
49

Deleting ~/Library/Developer/Xcode and restarting Xcode fixed this for me (Xcode 6 B7). Suspect an aggressive caching bug. Warning! This deletes archives from all your projects.

No amount of cleaning / build folder cleaning / derived data deleting helped before that.

Islet answered 4/9, 2014 at 11:30 Comment(4)
I'll switch your answer to the correct one (since I can no longer reproduce the issue, and several people verified that your solution works).Evanston
CAREFUL! This will also wipe out all your archives from all your projects!Githens
Instead try deleting /Xcode/DerivedData/ModuleCache. That solves the purpose.Misdirection
please, could you explain to me what implicates, in practice, the warning?Ungrudging
C
90

I faced this issue on OS10.10 with Xcode 6. I resolved issue by removing .pcm files.

To delete press 'shift+command+g' & delete all .pcm files or goto the folder ~/Library/Developer/Xcode/DerivedData/ModuleCache/ & delete all .pcm files.

Perform deep clean by pressing 'shift+alt+command+k.

Hope it will work for you.

Chukchi answered 7/8, 2014 at 12:44 Comment(8)
Thank you for explaining where they are and the environment you were in.Throw
Deleting the whole ModuleCache folder worked for me with Xcode6Lexicology
OSX 10.10.2/Xcode 6.2. 1) There are no .pcm files listed anywhere in my project. 2) Pressing shift+command+g in Xcode does nothing except make a bonk! sound. 3) There are no .pcm files in the directory ~/Library/Developer/Xcode/DerivedData/ModuleCache/Nashville
None of my old projects will build, and a new project won't build either. Wow, Xcode6 is a super IDE!Nashville
@Nashville I have not started using XCode6.2.x. Might be possible that Apple made some changes in Xcode IDE.Chukchi
What worked for me was doing what @Chinch suggested: ~/Library/Developer/Xcode$ rm -rf DerivedData.Nashville
Cool,it is good way to clean pem files. Awesome. ThanksCommendatory
Deleting ModuleCache also worked in 2023 with Xcode 14.3 🎉Fraternal
I
49

Deleting ~/Library/Developer/Xcode and restarting Xcode fixed this for me (Xcode 6 B7). Suspect an aggressive caching bug. Warning! This deletes archives from all your projects.

No amount of cleaning / build folder cleaning / derived data deleting helped before that.

Islet answered 4/9, 2014 at 11:30 Comment(4)
I'll switch your answer to the correct one (since I can no longer reproduce the issue, and several people verified that your solution works).Evanston
CAREFUL! This will also wipe out all your archives from all your projects!Githens
Instead try deleting /Xcode/DerivedData/ModuleCache. That solves the purpose.Misdirection
please, could you explain to me what implicates, in practice, the warning?Ungrudging
R
24

Remove the pcm file

rm "/var/folders/pj/hslm53_51xxd_npfqym5r6z00000gn/C/com.apple.DeveloperTools/5.0-5A1412/Xcode/5.0-5A1412/Xcode/ModuleCache/FUW5IOHP9BIS/CoreBluetooth.pcm"

then

Clean Project( Cmd+Shift+K)

Problem solved

Ruth answered 13/1, 2014 at 8:51 Comment(4)
I've tried deleting the whole ModuleCache folder with no success (see question). Unless you're implying that deleting just the CoreBluetooth.pcm will fix the problem.Evanston
for my case, i just need to delete pcm file then clean and it worked :)Ruth
@Mark: ya, i meant so, because in the most of my cases i always try like this first. :DRuth
the solution for me with my Jenkins build was to add rm -Rf $TMPDIR../C/com.apple.DeveloperTools/*/Xcode/*/Xcode/SharedPrecompileHeaders/Group
G
5

Just select clean from the project menu. That should force a complete rebuild and solve the rproblem.

Geaghan answered 16/10, 2013 at 23:48 Comment(3)
This is the first thing I tried. Clean did not fix the issue, nor did build folder clean. Neither did deleting the derived data folder.Evanston
@Mark, sounds like an Xcode bug. I would suggest submitting an Apple Radar bug.Geaghan
Will do. I'll link the radar bug in the original question once I've submitted it.Evanston
G
4

Try going to your Organizer -> Projects, and you'll see the path for where you're derived data is saved. Mine looks something like "~/Library/Developer/Xcode/DerivedData/[Project name]-[mumbo jump]"

Delete the "[Project name]-[mumbo jump]" folder, and you should be all good.

Goodish answered 16/10, 2013 at 17:40 Comment(2)
This is what the link in my question suggested, and it is the first thing I tried. It does not fix my issue, as the error is thrown again.Evanston
The important part for me was to find where my derived data is and cleaning that, rather than assuming it's in ~/Library/. Mine is at ~/Developer/Xcode/DerivedData so I cleaned that and the ModuleCache and that fixed itFefeal
S
4

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.

Suckling answered 14/8, 2014 at 9:50 Comment(0)
C
4

Manually deleting the DerivedData folder fixed it for me.

Chinch answered 22/9, 2014 at 13:4 Comment(1)
Yes, this worked for me too. Thanks! $ cd ~/Library/Developer/Xcode/ then ~/Library/Developer/Xcode$ rm -rf DerivedData.Nashville
E
2

So it seems the only way to fix this issue is to uninstall Xcode and download it again. This fixed my problem.

Evanston answered 16/10, 2013 at 18:22 Comment(4)
I agree it's very strange. There's probably something going on that we've missed. An uninstall just happens to reset it.Evanston
Slightly less extreme - deleting ~/Library/Developer/Xcode worked in my case (no amount of cleaning did).Islet
Good to know there's alternatives to uninstalling Xcode.Evanston
Better yet, delete just ~/Library/Developer/Xcode/ModuleCache. That way you don't lose all the other data.Crystallization
S
2

quit xcode and reopen it .This fixed my problem.

Soapbark answered 31/10, 2013 at 12:45 Comment(0)
A
1

I was facing this issue. Deleting moduleCache and restarting Xcode & Mac did not help me to resolve the issue.

Solution that worked for me: I copied the path "/private/var/folders/5s/1q3qz48j6zxc028txvdyqhwr000btt/C/org.llvm.clang/ModuleCache" in Finder->Go to folder, deleted all the folders from that ModuleCache.

Now I am able to build successfully.

Ake answered 27/4, 2016 at 6:17 Comment(0)
C
0

You can also try these, clean and then build again

find /var/folders 2>&1 | grep -v 'Permission denied' | grep '\.pcm' | xargs rm
find ~/Library/Developer/Xcode/DerivedData 2>&1 | grep -v 'Permission denied' | grep '\.pcm' | xargs rm
Concord answered 25/11, 2014 at 9:14 Comment(0)
B
0

Nothing above works for me, even uninstalling Xcode. Finally, I tried copying the modified file from other project to my current project, this worked.

Bourse answered 14/1, 2016 at 15:55 Comment(0)
A
0

I tried deleting the precompiled ~/Library/Developer/Xcode and restarting Xcode, plus a few of the other ideas presented here, nothing was working. As it seems to be a multiple-target kind of issue, I found after changing the target to another target, building/uploading the other target successfully, then changing back (after doing the other things) to the target I was looking to build / upload originally, I was finally successful.

Apothecary answered 8/2, 2017 at 3:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.