当我在 xcode 9.2 中从 xcode 9.3 的代码打开时出现“无法加载项目,不兼容的项目版本”弹出窗口

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

"Failed to load Project , incompatible project version" pop up appears when I open from code of xcode 9.3 in xcode 9.2

xcodexcode9.2xcode9.3

提问by Suresh Mopidevi

I created a project in Xcode 9.3, and When I open the same project in Xcode 9.2, it shows "incompatible project version". - I changed deployment target version

我在 Xcode 9.3 中创建了一个项目,当我在 Xcode 9.2 中打开同一个项目时,它显示“不兼容的项目版本”。- 我更改了部署目标版本

It asked to sign in with the team to run the project in Xcode 9.3. Without signing in, it shows error and does not get deployed.

它要求与团队一起登录以在 Xcode 9.3 中运行该项目。如果没有登录,它会显示错误并且不会被部署。

回答by Quoc Nguyen

If you can open the Project

如果你能打开 Project

You can simply change your Project Format(like the image)

您可以简单地更改您的Project Format(如图像)

Click to your Project File in xcode and change it

在 xcode 中单击您的项目文件并更改它

enter image description here

在此处输入图片说明

If you can't open the project (projectName.xcodeproj) normally

如果您无法正常打开项目 ( projectName.xcodeproj)

Control-click on the project file, select Show Package Contents, and then open your project.pbxprojfile and make the change for:

按住 Control 键单击项目文件,选择Show Package Contents,然后打开您的project.pbxproj文件并对以下内容进行更改:

compatibilityVersion
objectVersion

For Xcode 10.0

对于 Xcode 10.0

compatibilityVersion: "Xcode 10.0"
objectVersion :51

For Xcode 9.3:

对于 Xcode 9.3:

compatibilityVersion: "Xcode 9.3"
objectVersion :50

For Xcode 8.0-9.2:

对于 Xcode 8.0-9.2:

compatibilityVersion: "Xcode 8.0"
objectVersion: 48

You can find the project.pbxprojfile by right clicking the .xcodeprojfile in the project folder, then select Show Package Contents

您可以project.pbxproj通过右键单击.xcodeproj项目文件夹中的文件找到该文件,然后选择Show Package Contents

回答by Abbey Hymanson

I edited Datasun's comment above to include correct info but here is info for other Xcode versions. You must change both compatibilityVersion and objectVersion.

我编辑了上面 Datasun 的评论以包含正确的信息,但这里是其他 Xcode 版本的信息。您必须同时更改兼容性版本和对象版本。

In the project.pbx file you need to make two changes:

在 project.pbx 文件中,您需要进行两项更改:

  1. compatibilityVersion
  2. objectVersion
  1. 兼容性版本
  2. 对象版本


For Xcode 9.3+:

对于 Xcode 9.3+:

  • compatibilityVersion is "Xcode 9.3"
  • objectVersion is 50
  • 兼容性版本是“Xcode 9.3”
  • 对象版本是 50

For Xcode 8.0-9.2:

对于 Xcode 8.0-9.2:

  • compatibilityVersion is "Xcode 8.0"
  • objectVersion is 48
  • 兼容性版本是“Xcode 8.0”
  • 对象版本是 48

For Xcode 6.3-7.3.1:

对于 Xcode 6.3-7.3.1:

  • compatibilityVersion is "Xcode 6.3"
  • objectVersion is 47
  • 兼容性版本是“Xcode 6.3”
  • 对象版本是 47

回答by Datasun

Changing project formatis the right way to do it. But this requires you to be able to open the project, which is not the case. Therefore you can manually edit project.pbxproj(you have to open *.xcodeprojto see this file) and look for compatibilityVersion:

更改项目格式是正确的方法。但这需要您能够打开项目,而事实并非如此。因此,您可以手动编辑project.pbxproj(您必须打开*.xcodeproj才能看到此文件)并查找compatibilityVersion

compatibilityVersion = "Xcode 9.3";

兼容性版本 = "Xcode 9.3";

Then you can set the required version to a lower one. In this case it would be "Xcode 9.2", which requires you to also set the "objectVersion = 50" to 48. This value directly correlates to the Xcode project format.

然后您可以将所需的版本设置为较低的版本。在这种情况下,它将是“Xcode 9.2”,这要求您还将“objectVersion = 50”设置为48。该值与 Xcode 项目格式直接相关。

Important: After this step you should be able to open Xcode andto change project formatagain from within Xcode to make sure any missing fields are updated accordingly.

重要提示:在此步骤之后,您应该能够打开 Xcode再次从 Xcode 中更改项目格式,以确保相应地更新任何缺失的字段。

回答by Priti Kanauziya

For some people who are getting problem for searching the compatibilityVersion and objectVersion .Please follow these steps :

对于某些在搜索 compatibleVersion 和 objectVersion 时遇到问题的人,请按照以下步骤操作:

1)compatibilityVersion : Click on your .xcodeproj project in upper right (There are two icons) click on first Identity and type. And change the Project format .

1)compatibilityVersion :单击右上角的 .xcodeproj 项目(有两个图标)单击第一个 Identity 并键入。并更改项目格式。

2). objectVersion : Select .xcodeproj file with right click, select show package contents, now open the .pbx file with textedit and replace the 50 with a 48 (or something else)

2)。objectVersion :右键单击选择 .xcodeproj 文件,选择显示包内容,现在用 textedit 打开 .pbx 文件并将 50 替换为 48(或其他)

Refernce : https://github.com/pwn20wndstuff/noncereboot1131UI/issues/2

参考:https: //github.com/pwn20wndstuff/noncereboot1131UI/issues/2