68
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?

1

20 Answers 20

85

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.

1
  • 1
    It seems this can also happen if a workspace shuts down uncleanly - short solution worked for me.
    – Rob Hogan
    Oct 8, 2018 at 13:39
20

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.

1
  • 1
    I tried various other approaches in the answers to this question, but removing the framework made that specific error go away (I haven't re-added it, yet)
    – clearlight
    Jun 2, 2019 at 13:11
15

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

2
  • 3
    Xcode 10.2.1, tried it today (6/2/19). Didn't resolve it.
    – clearlight
    Jun 2, 2019 at 13:03
  • Xcode 13.3 issue fixed after this solutions. After reboot, the message told me which file is linked and not found, just had to delete ref Mar 29, 2022 at 13:24
12

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

9

Just Restarted my Xcode and the problem went away

7

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.

1
  • 5
    +1 Removing and re-adding *.framework from Linked Frameworks and Libraries section resolved my issue as well
    – coletrain
    May 29, 2019 at 15:58
4

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

3

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.

1
  • I don't know which folder disappeared and the message is not saying so: any idea how to resolve? May 27, 2020 at 17:38
2

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
2

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
1
  • Ironically I was getting some other weird error and doing what you said fixed that, but not the error I was getting. But it is slightly different than the questioner's error message. XCBCore.BuildFile (namedReferencesCannotBeResolved)
    – clearlight
    Jun 2, 2019 at 13:07
1

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.

1

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.

1
  • You saved my sanity, brother! This was driving me bugnuts for days until I saw your post, and solved it by changing my project's "Project Format" version to match the Xcode version. I posted an answer to someone else's question about this, and gave you a shout-out. stackoverflow.com/questions/63640191/…
    – Bob Murphy
    Jan 5, 2021 at 4:21
1

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.

0

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

0

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.

0

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

0

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.

0
0

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.

0
  1. Find UUID that is causing this error:

    % grep -R "90ea71"

  2. Delete a file, that contains the UUID:

    % rm ./YourApp.xcworkspace/xcuserdata/yourusername.xcuserdatad/UserInterfaceState.xcuserstate

0

For me, this error occurred while also accompanied by Xcode 10 Error: Multiple commands produce errors during the troubleshooting process.

In my case, I had a main project that had a reference to BFramework.xcodeproj which built a B.framework included in my main app bundle. BFramework.xcodeproj, in turn, had a reference to (and relied on) ANTLR4Framework.xcodeproj. The main app also had a reference to (and relied on) ANTLR4Framework.xcodeproj, to build the ANTLR4.framework and include it in the app bundle alongside of B.framework.

BFramework.xcodeproj had a relative path style reference to ANTLR4Framework.xcodeproj (which is the kind you probably want). The problem arose because my main app project had an absolute path style reference to the ANTLR4Framework.xcodeproj project. This means everything built and worked fine for the original project because they were both referencing the same ANTLR4Framework.xcodeproj project on the file system. When I duplicated the project in the Finder and opened it in Xcode, I began getting error messages like in Xcode 10 Error: Multiple commands produce. That was because BFramework.xcodeproj was referencing the newly duplicated ANTLR4Framework.xcodeproj while the main project was referencing the previous absolute path to the original ANTLR4Framework.xcodeproj. When I renamed the original project folder, that caused the absolute path reference to be broken, which resulted in the Unable to resolve build file: XCBCore.BuildFile (missingTargetProductReference... messages.

For me, removing the absolute path reference to the ANTLR4Framework.xcodeproj project from the main project and then adding it back as a relative reference solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.