freddrock
freddrock

Reputation: 171

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?

Upvotes: 6

Views: 11073

Answers (6)

brandav
brandav

Reputation: 705

My issue was related to dropbox.

I use a pc for development and a mac to build in xcode, so I store my project in dropbox. Sometimes dropbox can corrupt .pbxproj or even .plist files going from pc to mac, so when I attempt to open a project on my mac, xcode will throw the above parse error.

I had to zip the xcode project folder on the pc side, then on the mac side pull it out of the dropbox folder and unzip it. Then move it back to its original location. It's a pain but it worked.

Upvotes: 0

Shannon Rowe
Shannon Rowe

Reputation: 66

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.

Upvotes: 0

Hellium
Hellium

Reputation: 7356

Faced the same issue today (Unity 2017.1.1).

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

enter image description here

Upvotes: 0

Anibal Itriago
Anibal Itriago

Reputation: 1051

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!

Upvotes: 35

freddrock
freddrock

Reputation: 171

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!

Upvotes: 1

Alex Sink
Alex Sink

Reputation: 1

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

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

Upvotes: 0

Related Questions