xCode 不会从 Unity 解析项目

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

xCode will not parse project from Unity

iosxcodeparsingunity3d

提问by freddrock

I am working on a different iOS project in Unity and I have built it by exporting to Xcode (like I always have).

我正在 Unity 中开发一个不同的 iOS 项目,我通过导出到 Xcode 来构建它(就像我一直做的那样)。

Whenever I try to open the "Unity-iPhone.xcodeproj" in Xcode, it gives me the following error:

每当我尝试Unity-iPhone.xcodeproj在 Xcode 中打开“ ”时,都会出现以下错误:

Project cannot be opened because the project file cannot be parsed.

无法打开项目,因为无法解析项目文件。

I have looked everywhere but cannot figure it out.

我到处找,但无法弄清楚。

  1. The project name does not have any spaces in it.

  2. I have checked the .plistand everything looks fine.

  3. The bundle identifier matches that in .plist.

  1. 项目名称中没有任何空格。

  2. 我已经检查过.plist,一切看起来都很好。

  3. 包标识符与 中的匹配.plist

This has worked in previous projects but now I am getting this error for some reason. What gives?

这在以前的项目中有效,但现在由于某种原因我收到此错误。是什么赋予了?

采纳答案by freddrock

Well, after a couple days I have found the problem and it all has to do with the naming of the *.a files that the plugins import.

好吧,几天后我发现了问题,这一切都与插件导入的 *.a 文件的命名有关。

XCode does not allow for files to have spaces in their names (of course) but I had not caught that 3 of the *.a files from plugins had spaces in them.

XCode 不允许文件名中有空格(当然),但我没有发现插件中的 3 个 *.a 文件中有空格。

After removing these plugins (I have different plugins that do the same thing anyways) xCode was able to parse the build and create a project for me!

删除这些插件后(我有不同的插件做同样的事情)xCode 能够解析构建并为我创建一个项目!

Be careful of spaces!

小心空格!

回答by Anibal Itriago

Today, I've been facing this problem (Unity Ver. 5.5 Windows Based system).

今天,我一直在面对这个问题(Unity Ver. 5.5 Windows Based system)。

When I try to open my windows exported iOS project, i got "(..)the project file cannot be parsed". So, I decided to explore the project file, located in:

当我尝试打开 Windows 导出的 iOS 项目时,出现“(..) 项目文件无法解析”。因此,我决定探索位于以下位置的项目文件:

{Project path}/Unity-iPhone.xcodeproj/project.pbxproj

{项目路径}/Unity-iPhone.xcodeproj/project.pbxproj

It is a plain text file, so you can use any text editor.

它是一个纯文本文件,因此您可以使用任何文本编辑器。

I found a line with a mismatched quotes. It was:

我发现一行引号不匹配。它是:

shellScript = "\"$PROJECT_DIR/MapFileParser.sh\""\nrm -rf \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data/Raw/QCAR\"";

shellScript = "\"$PROJECT_DIR/MapFileParser.sh\""\nrm -rf \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data/Raw/QCAR\"";

To fix the problem, simply remove the quotation mark located at:

要解决此问题,只需删除位于以下位置的引号:

(...)MapFileParser.sh\" "\n(...)

(...)MapFileParser.sh\" "\n(...)

It should be:

它应该是:

(...)MapFileparser.sh\" \n(...)

(...)MapFileparser.sh\" \n(...)

and it will be parsed correctly in xCode.

它将在 xCode 中正确解析。

It's an automated typo error!

这是一个自动的拼写错误!

Good luck!

祝你好运!

回答by Alex Sink

Incompatable version of Xcode?
Are you using plugins? Most modify the project.

Xcode 版本不兼容?
你在使用插件吗?大多数修改项目。

Try creating a new project and creating a build. If it works, it's a plugin, otherwise an Xcode version.

尝试创建一个新项目并创建一个构建。如果它有效,它就是一个插件,否则就是一个 Xcode 版本。

回答by Hellium

Faced the same issue today (Unity 2017.1.1).

今天遇到了同样的问题(Unity 2017.1.1)。

Nothing related with the answers above. I just made a mistake in the Profile IDin the Player Settings of iOS : Edit> Project Settings> Player> iPhone, iPod Touch and iPad Settings> Other Settings> Identification.

与上述答案无关。我只是在iOS 的播放器设置中的配置文件 ID中犯了一个错误:Edit> Project Settings> Player> iPhone, iPod Touch and iPad Settings> Other Settings> Identification

enter image description here

在此处输入图片说明

回答by Shannon Rowe

I was getting this issue in Unity 2017.2 this week (building on Windows and then copying the build files over to the Mac for use in Xcode), and can confirm that the fix to the shell script line to remove the double quote as described by Anibal Itriago above worked in my case. Even an entirely blank iOS project with Vuforia disabled was failing to parse, but the line fix seems to resolve it.

本周我在 Unity 2017.2 中遇到了这个问题(在 Windows 上构建,然后将构建文件复制到 Mac 以在 Xcode 中使用),并且可以确认对 shell 脚本行的修复以删除双引号,如 Anibal 所述上面的 Itriago 在我的情况下工作。即使是禁用了 Vuforia 的完全空白的 iOS 项目也无法解析,但行修复似乎解决了它。