I have been working for a while to create an iPhone app. Today when my battery was low, I was working and constantly saving my source files then the power went out...
<
Muhammad's answer was very helpful (and helped lead to my fix). However, simply removing the >>>>>>> ======= <<<<<<< wasn't enough to fix the parse issue in the project.pbxproj (for me) when keeping changes from both branches after a merge.
I had a merge conflict in the PBXGroup section (whose beginning is indicated by a block comment like this: /* Begin PBXGroup section */) of the project.pbxproj file. However, the problem I encountered can occur in other places in the project.pbxproj file as well.
Below is a simplification of the merge conflict I encountered:
<<<<<<< HEAD
id = {
isa = PBXGroup;
children = (
id
);
name = "Your Group Name";
=======
id = {
isa = PBXGroup;
children = (
id
);
name = "Your Group Name";
>>>>>>> branch name
sourceTree = "";
};
When i removed the merge conflict markers this is what I was left with:
id = {
isa = PBXGroup;
children = (
id
);
name = "Your Group Name";
id = {
isa = PBXGroup;
children = (
id
);
name = "Your Group Name";
sourceTree = "";
};
Normally, removing the merge conflict markers would fix the parse issue in the project.pbxproj file and restore the workspace integrity. This time it didn't.
Below is what I did to solve the issue:
id = {
isa = PBXGroup;
children = (
id
);
name = "Your Group Name";
sourceTree = "";
};
id = {
isa = PBXGroup;
children = (
id
);
name = "Your Group Name";
sourceTree = "";
};
I actually had to add 2 lines at the end of the first PBXGroup.
You can see that if I would have chosen to discard the changes from either Head or the merging branch, there wouldn't have been a parse issue! However, in my case I wanted to keep both groups I added from each branch and simply removing the merge markers wasn't enough; I had to add extra lines to the project.pbxproj file in order to maintain correct formatting.
So, if you're running into parsing issues after you thought you'd resolved all you're merge conflicts, you might want to take a closer look at the .pbxproj and make sure there aren't any formatting problems!