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...
<This is because project names are not suppose to have blank spaces in between them
If you ever merge and still get problems that dont know what they are, I mean not the obvious marks of a diff
<<<<<
....
======
>>>>>>
Then you can analise your project files with https://github.com/Karumi/Kin, install it and use it
kin project.pbxproj
It has make extrange erros that doesn't allow open the project more easy to understand and solve (ones of hashes, groups and so on).
And by the way, this could also be helpful, thought I have not used it try to diff 2 versions of your project files https://github.com/bloomberg/xcdiff so this will give you really what is going on.
Visual analysis of the Xcode project file did not help me to locate error after merging. After looking to syslog found such line when Xcode trying to parse the file:
2/7/14 12:39:12.792 PM Xcode[9949]: CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 4426. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
After fixing that project can be opened ok.
I just ran into same problem. I removed generated strings by git as always but Xcode still refused to open .xcodeproj file. But everything was correct, no missing brackets etc. Finally I tried to quit Xcode and open project when Xcode was closed.. then it worked. I hope this helps someone.
EDIT:
for resolving conflicts in your .xcodeproj file you can use this handy script:
Here is the script:
projectfile=find -d . -name 'project.pbxproj'
projectdir=echo *.xcodeproj
projectfile="${projectdir}/project.pbxproj"
tempfile="${projectdir}/project.pbxproj.out"
savefile="${projectdir}/project.pbxproj.mergesave"
cat $projectfile | grep -v "<<<<<<< HEAD" | grep -v "=======" | grep -v "^>>>>>>> " > $tempfile mv $tempfile $projectfile
Run it from terminal using sh command: sh resolve_conflicts.sh
Steps to be followed:- 1.Navigate to folder where your projectName.xcodeproj 2.Right click and select 'Show Package Contents'. You will be able to see list of files with .pbxproj extension. 3.Select project.pbxproj. Right click and open this file using 'Text Edit'. 4.You will be able to see <<<<<<, ============ and >>>>>>>>>>. These are generally conflicts that arise when you take update from Sourcetree/SVN/GITLAB. Delete these and save file. 5.Now, you'll be able to open project without any error message.
Analyse the syntax of your project file. Check it inside your project in terminal:
plutil -lint project.pbxproj
This will show you the errors from the parser.
Possible problem: Some projects set git merging strategy union
for project files. This works for most of the times, but will silently kill your project file if it fails. This strategy is defined in the .gitattributes
file in your repository.