error: Unable to resolve build file: XCBCore.BuildFile

IosXcodeXcode10

Ios Problem Overview


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?

Ios Solutions


Solution 1 - Ios

For XCode 10 Beta: Problem occurs when I have two workspaces open that share the same project directories. Solution was

Short version

  1. Shut down all but one workspaces

  2. exit XCode and reopen XCode

  3. XCode > Product > Clean Build Folder

Longer version

  1. Shut down all but one workspace
  2. XCode > Preferences > Locations > Derived Data > goto directory ~/Library/Developer/Xcode/DerivedData
  3. Clear out subdirectories from DerivedData
  4. exit XCode and reopen XCode
  5. XCode > Product > Clean Build Folder

Thanks to @aferriss answer for the clue.

Solution 2 - Ios

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.

error message

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.

Solution 3 - Ios

For me, XCode > Product > Clean Build Folder and restart Xcode then worked.

Solution 4 - Ios

This was the culprit for my experience of the same error: missing Command Line Tools setting

After setting the correct version of Command Line Tools (i.e., Xcode 10.2.1; see below) on my system, the error went away!

correct Command Line Tools setting

Solution 5 - Ios

Just Restarted my Xcode and the problem went away

Solution 6 - Ios

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.

Solution 7 - Ios

I had an embedded Xcode project that was not found (light blue). Deleting it and dropping it in again solved the issue.

Solution 8 - Ios

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

Solution 9 - Ios

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

Solution 10 - Ios

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.

Solution 11 - Ios

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.

Solution 12 - Ios

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.

Solution 13 - Ios

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.

Solution 14 - Ios

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

Solution 15 - Ios

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.

Solution 16 - Ios

I've faced the problem in Xcode 10.1.2. Xcode restarting and the clean project solve it in my case.

Solution 17 - Ios

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.

Solution 18 - Ios

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTresView Question on Stackoverflow
Solution 1 - IosWarren StringerView Answer on Stackoverflow
Solution 2 - IosaferrissView Answer on Stackoverflow
Solution 3 - IoswkmView Answer on Stackoverflow
Solution 4 - Ios98chimpView Answer on Stackoverflow
Solution 5 - IosShubham GoelView Answer on Stackoverflow
Solution 6 - IosempView Answer on Stackoverflow
Solution 7 - IosHeestand XYZView Answer on Stackoverflow
Solution 8 - IosehacinomView Answer on Stackoverflow
Solution 9 - IosdjromeroView Answer on Stackoverflow
Solution 10 - IosAurimas PetreviciusView Answer on Stackoverflow
Solution 11 - IosYaNuSHView Answer on Stackoverflow
Solution 12 - IosAaronView Answer on Stackoverflow
Solution 13 - IosDaniel VengoecheaView Answer on Stackoverflow
Solution 14 - IosJaeyo KehView Answer on Stackoverflow
Solution 15 - IosTommie C.View Answer on Stackoverflow
Solution 16 - IosYuliaView Answer on Stackoverflow
Solution 17 - IosVinod MadigeriView Answer on Stackoverflow
Solution 18 - IosAlexMathView Answer on Stackoverflow