error: Unable to resolve build file: XCBCore.Build

2020-02-24 12:20发布

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?

18条回答
劳资没心,怎么记你
2楼-- · 2020-02-24 12:45

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

查看更多
Summer. ? 凉城
3楼-- · 2020-02-24 12:45

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

查看更多
We Are One
4楼-- · 2020-02-24 12:46

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.

查看更多
Explosion°爆炸
5楼-- · 2020-02-24 12:48

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.

查看更多
趁早两清
6楼-- · 2020-02-24 12:49

Just Restarted my Xcode and the problem went away

查看更多
仙女界的扛把子
7楼-- · 2020-02-24 12:50

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.

查看更多
登录 后发表回答