error: Unable to resolve build file: XCBCore.BuildFile (missingTargetProductReference("3bf83096e50de72a94699e9afc1133ebe3512682230d04680075c283a974e273")) (in target 'MyTarget')
Xcode 10 is giving this error immediately when trying to build our project. It's not immediately clear what is causing it.
How can I resolve it?
For XCode 10 Beta: Problem occurs when I have two workspaces open that share the same project directories. Solution was
Short version
Shut down all but one workspaces
exit XCode and reopen XCode
XCode > Product > Clean Build Folder
Longer version
Shut down all but one workspace
XCode > Preferences > Locations > Derived Data > goto directory ~/Library/Developer/Xcode/DerivedData
Clear out subdirectories from DerivedData
exit XCode and reopen XCode
XCode > Product > Clean Build Folder
Thanks to #aferriss answer for the clue.
I came across this same error while using openframeworks 0.10 with xcode 10 recently. It seems like it was caused by having multiple openframeworks projects opened at a time. If you close them all one by one, and then reopen the one you'd like to work on, it should resolve the error. Hoping this is just an xcode-beta thing.
Xcode used to tell you that there as a workspace integrity problem, and you could just ignore it. But it seems like it's returned. There's some discussion about this issue here.
For me, XCode > Product > Clean Build Folder and restart Xcode then worked.
This was the culprit for my experience of the same error:
After setting the correct version of Command Line Tools (i.e., Xcode 10.2.1; see below) on my system, the error went away!
Just Restarted my Xcode and the problem went away
The key here is missingTargetProductReference, or you might get namedReferencesCannotBeResolved. Xcode can't find something.
This happened after upgrading to Swift5/Xcode10.
I found that removing linked frameworks and then re-adding them fixed the issue.
I had an embedded Xcode project that was not found (light blue). Deleting it and dropping it in again solved the issue.
In case this helps, I had a new repo and the Libraries weren't correctly linked.
I opened Xcode, cleaned, and went through, one by one, through Libraries on the menu. I clicked on it, which opened the info panel on the right, and pressed the small folder button, and found the path designated and clicked and opened, to make Xcode recognize those Libraries. Path names were often
/node_modules/react-native/Libraries/(something)/(something).xcodeproj
In my case, after trying all solutions in this question and some more (including updating Xcode 10.2 beta and even macOS), the only thing that worked was accessing the project bundle (right click > Show Package Contents) and remove everything except project.pbxproj:
project.xcworkspace
xcshareddata
xcuserdata
If you have a File Group which is backed by a physical folder and that physical folder has been deleted then you will get the same error "Unable to resolve build file: XCBCore.BuildFile".
In my case the physical folder has been removed (because I removed all "real" files from it) and in XCode group there was still one external project linked.
Solution:
- created a new group (without a folder) in XCode
- Moved external project reference there.
- rebuilt the project
Error gone.
For me there was a different solution after none of the above worked.
The problem started after using unlink for one of my packages.
Then for some reason, the Package was still there under Libraries, but it was greyed. After deleting the greyed Library, everything started working again.
My solution was that I was using the wrong Xcode version for the project I was working with. It still required 10.1 and I was attempting to run in 10.2. I instead opened it in 10.1 and the error went away while successfully compiling.
The problem is that on new xcode 10.2 there is a new BUILD Configuration, you need to change to LEGACY.
You can check how to change it here: https://medium.com/xcblog/five-things-you-must-know-about-xcode-10-new-build-system-41676cd5fd6c . CHECK THE GIF
So if you have a newer version of xcode different than the one used when the project was working probably this is what is causing the issue.
I have the same problem. Because a folder not upload to Git server, git not allow upload empty folder, then I create a folder in project folder, and it work well.
missing folder
In my case, it was a simple issue of a missing file.
Checked all secondary error messages. Error report said that my bridging-header.h file was not being found. Checked the path of the missing file from the target settings (just search for .h to get the right setting key). Fixed the new path and error went away.
The cause:
I had reorganized my folders after a system crash and added a second level to my project location.
I've faced the problem in Xcode 10.1.2. Xcode restarting and the clean project solve it in my case.
Seems like there are a number of reasons for which one runs into the same error. For my case, it was not having the Submodule checked out locally. After I made sure all my Submodules were downloaded, the error went away.
I had correct Command Line Tools and cleaning did nothing for me.
While resolving a merge conflict, A Group named "Recovered References" had appeared in my project navigator. Probably due to a mistake I made during merging. The Group was empty and deleting it fixed my problem.
I have a few kits installed but now I decided I do not want to use Digits & Twitter anymore. I deleted the frameworks manually but they keep popping up in the Fabric app and in my dashboard.
I've been looking everywhere but an option to remove or delete the kits seems to be non existent. I also didn't find anything in the documentation about this.
I had the same issue as you. I tried wiping my DerivedData path and cleaning my build folder, but had no luck.
In the end the only thing that worked for me was deleting my App on Fabric and re-creating/re-installing it. I think the key step was removing the Run Script in Build Phases and re-adding it with the new key during the installation process.
I know it's not the best solution, but I can confirm that it works. The downside is if you had any other Kits installed (Answers, Beta, etc) I'm pretty sure you'll lose your data.
Try deleting the files DerivedData path and clean build folder
cmd+opt+shift+k
then re run the application.
Also check once again the Framework search path in xcode settings.
I have recently upgraded cocoapods to 0.39.0 and xcode to 7.1.
Even after updating pods for several times, I'm constantly getting this error as shown on snapshot.
I found a same question raised here.
The accepted answer is to use 'cocoapods' which I'm already using and the other answer is to downgrade the cocoapods version to 0.38.2. Again followed this link to downgrade cocoapods. But even after that I'm still getting the same error.
I have also tried to remove all pod files and update fresh, it didn't work out either.
Any help is much appreciated! Thanks.
Deleting Derived Data directory worked for me. Open Preferences of XCode and goto last tab Locations. Click on the marked tiny arrow:
Then I deleted this entire Derived Data directory. Re-running the app showed no issue.
I Just have add space mistakenly and close my project now I am stuck on this following issue.
fatal error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDate.h' has been modified since the precompiled header '/Volumes/Project/User/Data/Projects/Spender/Code/Git/MyProject/DerivedData/SPENDER/Build/Intermediates/PrecompiledHeaders/MyProject-Prefix-fhkddqkqywndkaajlfbnfgoftvif/MyProject-Prefix.pch.pch' was built
I googled and try every thing to delete Dervied folder, .PCM file and also clean, like also shown in this Thread.
So Kindly give my any idea how to fix this issue, I am on Xcode 6.0.
Looking for those who were victim of this.
Thanks
Delete Xcode and reinstall it. That's probably the easiest way to restore your iOS 8.0 SDK.
This type of error is usually fixed by cleaning the DerivedData folder, cleaning (CMD+K) the project and building (CMD+B). Restarting Xcode may also help.
Your original post isn't clear. Did you see those responses without attempting them, or did you attempt those solutions?
I just had this same problem. Delete the
~/Library/Developer/Xcode/DerivedData/ModuleCache directory
and restart Xcode.
(Thanks to this excellent answer; adding here for googlers)
I was running my application without any problems on both the simulator and device. All of a sudden i get this error:
fatal error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionView.h' has been modified since the precompiled header '/Users/rashidasgari/Library/Developer/Xcode/DerivedData/ModuleCache/SWBH8ZAWBXAH/UIKit.pcm' was built
note: after modifying system headers, please delete the module cache at '/Users/rashidasgari/Library/Developer/Xcode/DerivedData/ModuleCache/SWBH8ZAWBXAH'
I tried any solution i could find and still no luck. Note that i tried running the application on another MacBook and everything works fine without any errors.
Cleaning the project is the first port of call (menu under Product).
If that doesn't help, delete the derived data. That can be done via the Locations section of the preferences or by navigating to the directory in Finder and deleting it (there is a little -> button in preferences to get there, or use Go To Folder... option in the Finder.
Ok after trying almost every solution on web, i decided to reinstall xcode and it finally worked.
I solved this problem by changing DerivedData folder name..see how i did
Xcode->preferences->Then you will be redirected to preferences screen
Then click on locations tab under menu selection->then you will have options like Derived data,snap shots ,archives
under Derived data you can see some thing like /Users/SENABI/Library/Developer/Xcode/DerivedData-> then click on that arrow button that's it there you can see DerivedData folder click on that and rename it. your error will be removed.
This is my experience and it worked for me hope it will be helpful to someone.
Error occurs when system header files are modified.
Solution :
If you have the backup of XCode then reinstall the XCode (Better solution).
Delete the DerivedData folder and then build the project
Use CMD+Shift+K to clean the build and then relaunch. This should solve the issue.
you don't have to delete anything.
you messed up a git pull somewhere probably. just quit Xcode and the simulator, reset any changes (or stash them) try another git pull, start Xcode again, clean your project and run it again.