Unable to open project… cannot be opened because the project file cannot be parsed

前端 未结 21 2202
有刺的猬
有刺的猬 2020-12-04 08:34

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...

<
21条回答
  •  情深已故
    2020-12-04 09:10

    I faced the same problem recently when trying to merge my branch with a remote branch. However, none of the above solutions seemed appropriate to my problem.

    There were no merge conflicts between the project.pbxproj file in my branch or the remote branch. However, my projectName.xcodeproj file would refuse to open for the same reason as shown in the asked question.

    My solution was to look through the project.pbxproj using a text editor and find if there were any irregularities in the file syntax (for e.g. an extra curly bracket). I sped this process up by focusing on the lines which were inserted or deleted in old file as compared to the merged file. On closer examination, I found the cause of my problem was the repetition of the following line :

    xxxxxxxxxxxxx /* [CP] Check Pods Manifest.lock */ = {
    

    in my merged file. This led to an unclosed curly bracket and consequent invalid pbxproj syntax. Deleting the above line fixed my problem.

提交回复
热议问题