6

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?

wchargin
  • 15,589
  • 12
  • 71
  • 110
freddrock
  • 171
  • 1
  • 3
  • 10
  • http://stackoverflow.com/questions/361799/xcode-unable-to-open-project-cannot-be-opened-because-the-project-file-canno – Mick MacCallum May 30 '13 at 18:28
  • 1
    tried this... When I open my .pbxproj file it does not contain anything with "===" or "<<<<"... So this is not the error. – freddrock May 30 '13 at 18:32

6 Answers6

35

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!

Anibal Itriago
  • 1,051
  • 10
  • 13
1

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!

freddrock
  • 171
  • 1
  • 3
  • 10
0

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.

  • tried creating a new project with the assets, did not work. I found the solution though, going to post it. – freddrock Jun 04 '13 at 18:07
0

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

Hellium
  • 7,206
  • 2
  • 19
  • 49
0

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.

0

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.

brandav
  • 623
  • 4
  • 10