IT박스

프로젝트를 열 수 없습니다… 프로젝트 파일을 구문 분석 할 수 없기 때문에 열 수 없습니다.

itboxs 2020. 8. 31. 07:36
반응형

프로젝트를 열 수 없습니다… 프로젝트 파일을 구문 분석 할 수 없기 때문에 열 수 없습니다.


나는 아이폰 앱을 만들기 위해 한동안 일 해왔다. 오늘 배터리가 부족할 때 작업을하면서 소스 파일을 계속 저장했는데 전원이 꺼졌습니다.

이제 컴퓨터를 다시 연결하고 전원이 잘 들어 오면 프로젝트 파일을 열려고하면 오류가 발생합니다.

프로젝트를 열 수 없습니다

프로젝트 파일을 구문 분석 할 수 없기 때문에 ... 프로젝트를 열 수 없습니다.

내가 여기서 회복 할 수 있다는 것을 사람들이 아는 방법이 있습니까? 이전 프로젝트 파일을 사용하고 다시 삽입 한 다음 컴파일을 시도했습니다. 원하는 모든 파일을 찾지 못하기 때문에 아마도 펑키 한 오류가 발생합니다.

가능하면 프로젝트를 처음부터 다시 빌드하고 싶지 않습니다.


편집하다

좋아, 나는 이것과 작동하는 약간 오래된 프로젝트 파일을 비교했고 파일에 약간의 손상이 있음을 확인했습니다. 그것들 (좋은 부분과 최신 부분)을 병합 한 후 이제 작동합니다.

SVN에 대한 좋은 점. 나는 하나가 있지만 XCode를 그것과 동기화하려는 약간의 재미가 있습니다. 이제 더 많은 시간을 보내겠습니다 ... ;-)

여기에 이미지 설명 입력


나는이 문제를 발견했고 나의 선배는 나에게 해결책에 대해 말했다.

projectname.xcodeproj여기 에서 파일을 마우스 오른쪽 버튼으로 클릭 projectname하면 프로젝트 이름이됩니다. 이제 오른쪽 클릭 후 Show Packages Contents를 선택 합니다 . 그 후 projectname.pbxproj텍스트 편집기에서 파일 을 엽니 다 . 이제 포함하는 행을 검색 <<<<<<< .mine, =======>>>>>>> .r. 예를 들어 제 경우에는 다음과 같이 보였습니다.

<<<<<<< .mine
    9ADAAC6A15DCEF6A0019ACA8 .... in Resources */,
=======
    52FD7F3D15DCEAEF009E9322 ... in Resources */,
>>>>>>> .r269

이제 사람들을 제거 <<<<<<< .mine, =======그리고 >>>>>>> .r라인은 다음과 같을 것입니다 그래서

    9ADAAC6A15DCEF6A0019ACA8 /* BuyPriceBtn.png in Resources */,

    52FD7F3D15DCEAEF009E9322 /* discussionForm.zip in Resources */,

이제 Xcode 프로젝트를 저장하고 열고 빌드하십시오. 다 괜찮을거야.


무함마드의 답변은 매우 도움이되었습니다 (그리고 내 문제를 해결하는 데 도움이되었습니다). 그러나 >>>>>>> ======= <<<<<<<를 제거하는 것만으로는 project.pbxproj (나를 위해)의 구문 분석 문제를 해결하기에 충분하지 않았습니다. 병합 후.

project.pbxproj 파일의 PBXGroup 섹션에서 병합 충돌이 발생했습니다 (시작은 다음과 같은 블록 주석으로 표시됩니다 : / * Begin PBXGroup section * /). 그러나 내가 만난 문제는 project.pbxproj 파일의 다른 위치에서도 발생할 수 있습니다.

다음은 내가 만난 병합 충돌을 단순화 한 것입니다.

    <<<<<<< HEAD
          id = {
            isa = PBXGroup;
            children = (
                 id
            );
            name = "Your Group Name";
    =======
          id = {
            isa = PBXGroup;
            children = (
                 id
            );
            name = "Your Group Name";
    >>>>>>> branch name
            sourceTree = "<group>";
          };

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 = "<group>";
          };

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 = "<group>";
          };

          id = {
            isa = PBXGroup;
            children = (
                 id
            );
            name = "Your Group Name";
            sourceTree = "<group>";
          };

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!


I got this exact same error because Cordova will allow you to create a project with spaces in it, and Xcode doesn't know how to deal.


I had similar issue.

스크린 샷 1

Below are steps to resolve it:

  1. Navigate to folder where your projectName.xcodeproj.

    스크린 샷 2

  2. Right click and select 'Show Package Contents'. You will be able to see list of files with .pbxproj extension.

    스크린 샷 3

  3. Select project.pbxproj. Right click and open this file using 'Text Edit'.

    스크린 샷 4

  4. You will be able to see <<<<<< .mine , ============ and >>>>>>>>>> .r123. These are generally conflicts that arise when you take update from SVN. Delete these and save file.

    스크린 샷 5

    스크린 샷 6

  5. Now, you'll be able to open project without any error message.


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.


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.


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.


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:

  1. Create empty .sh file in your project directory ( e.g. resolve_conflicts.sh )
  2. 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

  3. Run it from terminal using sh command: sh resolve_conflicts.sh


Revert the project.pbxproj

svn revert --filename--


It sounds like you're going to have to create a new project in Xcode, go into the old directory, and drag all your source files, nibs, and resources into the Xcode files sidebar in the new project. It shouldn't take more than a few minutes, unless you really did a lot of work with custom build settings or targets. Either that, or revert to the last check-in in your source control and manually add any code files which changed between now and then.


And once you get things working again you should look into using something like subversion or mercurial for backup and revision control. Remember that he electrons don't always go where they are supposed to, backup early and often!


change your current project folder nam and checkout module the same project.then add the current file changes.


Just check the project.pbproject file and do a diff against a working version of the project file.

Often times this happens when you have conflicts from a version control system like posted here: User file cannot be parsed in subversion in MAC iphone SDK


Try to find HEAD and _HEAD between the lines and delete this words in project.pbxproj. Backup this file before doing this..


Goto PhoneGapTest >> platform 그런 다음 터미널로 이동 한 후 ios 폴더를 삭제하고 다음을 입력합니다. sudo phonegap build ios 후 프로젝트를 실행할 수 있습니다.


되 돌리면 가져온 코드를 실행 취소 할 수 있습니다.

풀 요청을 실행 취소하려면이 명령을 프로젝트 경로에 넣으십시오.

-> git merge --abort


이는 프로젝트 이름 사이에 공백이있는 것으로 간주되지 않기 때문입니다.


Subversion은 거의 매주 svn을 실행 한 후 내 프로젝트 파일을 손상시킵니다. 나는 그것이 지금 왜 이것을 하고이 문제를 발견했는지 알아 내려고 노력하고 있습니다.

참고 URL : https://stackoverflow.com/questions/361799/unable-to-open-project-cannot-be-opened-because-the-project-file-cannot-be-pa

반응형