ios 错误:无法解析构建文件:XCBCore.BuildFile

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/50708012/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:43:47  来源:igfitidea点击:

error: Unable to resolve build file: XCBCore.BuildFile

iosxcodexcode10

提问by Tres

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.

Xcode 10 在尝试构建我们的项目时会立即出现此错误。目前还不清楚是什么原因造成的。

How can I resolve it?

我该如何解决?

采纳答案by 98chimp

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!

在我的系统上设置正确版本的命令行工具(即 Xcode 10.2.1;见下文)后,错误消失了!

correct Command Line Tools setting

正确的命令行工具设置

回答by Warren Stringer

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

对于 XCode 10 Beta:当我打开两个共享相同项目目录的工作区时会出现问题。解决方案是

Short version

精简版

  1. Shut down all but one workspaces
  2. exit XCode and reopen XCode
  3. XCode > Product > Clean Build Folder
  1. 关闭除一个工作区以外的所有工作区
  2. 退出 XCode 并重新打开 XCode
  3. XCode > 产品 > 清理构建文件夹

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
  1. 关闭除一个工作区以外的所有工作区
  2. XCode > Preferences > Locations > Derived Data > goto directory ~/Library/Developer/Xcode/DerivedData
  3. 从 DerivedData 清除子目录
  4. 退出 XCode 并重新打开 XCode
  5. XCode > 产品 > 清理构建文件夹

Thanks to @aferriss answer for the clue.

感谢@aferriss 提供线索。

回答by aferriss

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.

我最近在 xcode 10 中使用 openframeworks 0.10 时遇到了同样的错误。似乎是由于同时打开了多个 openframeworks 项目造成的。如果您将它们一一关闭,然后重新打开您想要处理的那个,它应该可以解决错误。希望这只是 xcode-beta 的事情。

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.

Xcode 曾经告诉您存在工作区完整性问题,您可以忽略它。不过好像回来了。有一个关于这个问题的一些讨论在这里

回答by wkm

For me, XCode > Product > Clean Build Folderand restart Xcodethen worked.

对我来说,XCode > Product > Clean Build Folderrestart Xcode随后的工作。

回答by Shubham Goel

Just Restarted my Xcode and the problem went away

刚刚重新启动我的 Xcode,问题就消失了

回答by emp

The key here is missingTargetProductReference, or you might get namedReferencesCannotBeResolved. Xcode can't find something.

这里的关键是missingTargetProductReference,或者你可能会得到namedReferencesCannotBeResolved。Xcode 找不到东西。

This happened after upgrading to Swift5/Xcode10.

这发生在升级到 Swift5/Xcode10 之后。

I found that removing linked frameworks and then re-adding them fixed the issue.

我发现删除链接的框架然后重新添加它们解决了这个问题。

回答by Hexagons

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

我有一个未找到的嵌入式 Xcode 项目(浅蓝色)。删除它并再次放入它解决了这个问题。

回答by ehacinom

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 Librarieson 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

我打开 Xcode,清理并逐一浏览Libraries菜单。我点击它,打开右侧的信息面板,按下小文件夹按钮,找到指定的路径并点击打开,让Xcode识别那些库。路径名通常是

/node_modules/react-native/Libraries/(something)/(something).xcodeproj

回答by djromero

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:

就我而言,在尝试了此问题中的所有解决方案以及更多解决方案(包括更新 Xcode 10.2 beta 甚至 macOS)后,唯一有效的是访问项目包(右键单击 > 显示包内容)并删除除project.pbxproj以下内容之外的所有内容:

  • project.xcworkspace
  • xcshareddata
  • xcuserdata
  • project.xcworkspace
  • xcshareddata
  • xcuserdata

回答by YaNuSH

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.

对我来说,在上述方法都不起作用之后,有一个不同的解决方案。在对我的一个软件包使用 unlink 后,问题开始了。然后不知什么原因,这个包裹还在图书馆下面,但它是灰色的。删除灰色库后,一切又开始工作。