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
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
Manually deleting the DerivedData folder fixed it for me.
Nothing above works for me, even uninstalling Xcode. Finally, I tried copying the modified file from other project to my current project, this worked.
Just select clean from the project menu. That should force a complete rebuild and solve the rproblem.
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.
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.