Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xCode will not parse project from Unity

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

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

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 .plist and everything looks fine.

  3. The bundle identifier matches that in .plist.

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

like image 428
freddrock Avatar asked May 30 '13 18:05

freddrock


2 Answers

Today, I've been facing this problem (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:

{Project path}/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\"";

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

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

It should be:

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

and it will be parsed correctly in xCode.

It's an automated typo error!

Good luck!

like image 186
Anibal Itriago Avatar answered Sep 30 '22 20:09

Anibal Itriago


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.

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.

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!

Be careful of spaces!

like image 26
freddrock Avatar answered Sep 30 '22 21:09

freddrock