Mark
Mark

Reputation: 7409

file has been modified since the precompiled header was built

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.

Upvotes: 44

Views: 29239

Answers (13)

Philip McDermott
Philip McDermott

Reputation: 1068

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.

Upvotes: 49

Christopher Means
Christopher Means

Reputation: 1

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.

Upvotes: 0

Manisha
Manisha

Reputation: 55

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.

Upvotes: 1

user2755734
user2755734

Reputation: 1

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

Upvotes: 0

Maciej Swic
Maciej Swic

Reputation: 11359

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

Upvotes: 0

Laith
Laith

Reputation: 419

Manually deleting the DerivedData folder fixed it for me.

Upvotes: 4

KepPM
KepPM

Reputation: 1129

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.

Upvotes: 4

Gagan_iOS
Gagan_iOS

Reputation: 4060

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.

Upvotes: 90

khanghoang
khanghoang

Reputation: 1125

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

Upvotes: 24

satyso
satyso

Reputation: 21

quit xcode and reopen it .This fixed my problem.

Upvotes: 2

Duncan C
Duncan C

Reputation: 131398

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

Upvotes: 5

Mark
Mark

Reputation: 7409

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

Upvotes: 2

bunz4u
bunz4u

Reputation: 49

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.

Upvotes: 4

Related Questions