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?
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!
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
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.
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.
Just Restarted my Xcode and the problem went away
For XCode 10 Beta: Problem occurs when I have two workspaces open that share the same project directories. Solution was
Short version
Longer version
Thanks to @aferriss answer for the clue.