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 me,
XCode > Product > Clean Build Folder
andrestart Xcode
then worked.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.
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.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.
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
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.