Xcode 项目错误:无法打开 xcodeproj,因为它缺少它的 project.pbxproj 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21812805/
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-09-15 04:39:37  来源:igfitidea点击:

Xcode Project error: xcodeproj cannot be opened because it is missing its project.pbxproj file

xcode

提问by user3316198

I have been scratching my hair to solve this one. Here is what happened.

我一直在抓头发来解决这个问题。这是发生的事情。

I recently formatted my MAC and I synced all files back to it from my Dropbox account.

我最近格式化了我的 MAC,并将所有文件从我的 Dropbox 帐户同步回它。

For some reason I am getting this error each time I try to open any of my Xcode projects:

出于某种原因,每次我尝试打开我的任何 Xcode 项目时都会收到此错误:

xcodeproj cannot be opened because it is missing its project.pbxproj file.

xcodeproj cannot be opened because it is missing its project.pbxproj file.

Now, I've found several threads on stack overflow that suggest different solutions and one common is to pewit the .xcodeproj/project.pbxprojfile but when checking the content of my Xcode project I can't find such a file.

现在,我在堆栈溢出上发现了几个线程,它们提出了不同的解决方案,一个常见的方法是对.xcodeproj/project.pbxproj文件进行 pewit,但是在检查我的 Xcode 项目的内容时,我找不到这样的文件。

I don't know what I can do anymore as my Xcode skills are highly limited and I would really be thankful if someone could put me in the right direction.

我不知道我还能做什么,因为我的 Xcode 技能非常有限,如果有人能让我朝着正确的方向发展,我真的很感激。

Thanks!

谢谢!

回答by Heliotropix

The Xcode project file is a package (so it's really a folder). The project.pbxproj is stored inside the package. Go to Finder, right-click on your project file, select Show Package Contents. The project.pbxproj should be present. If not, go back and do the same thing with your copy in Dropbox.

Xcode 项目文件是一个包(所以它实际上是一个文件夹)。project.pbxproj 存储在包中。转到 Finder,右键单击您的项目文件,选择 Show Package Contents。project.pbxproj 应该存在。如果没有,请返回并在 Dropbox 中对您的副本执行相同的操作。

FYI, I can round trip a project file to and from Dropbox and it doesn't get corrupted.

仅供参考,我可以将项目文件往返 Dropbox,并且不会损坏。

回答by Nicoara Talpes

The solution is to wait for the folder (lets say Myproject) to completely sync. If there are other files to sync as brothers to Myproject then the project.pbxproj file will not be synced right away. You can move Myproject inside another newly created folder Myprojectparent outside the other brother files being synced bc the sync will be faster.

解决方案是等待文件夹(比如 Myproject)完全同步。如果还有其他文件作为兄弟同步到 Myproject,那么 project.pbxproj 文件将不会立即同步。您可以将 Myproject 移动到正在同步的其他兄弟文件之外的另一个新创建的文件夹 Myprojectparent 中,因为同步会更快。