Why is my project.pbxproj file changing its format

project.pbxproj is similar to json. But since I use the latest Xcode (7.3.1), it changes to plist.Here my project.pbxproj :

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>archiveVersion</key> <string>1</string> <key>classes</key> <dict/> <key>objectVersion</key> <string>46</string> <key>objects</key> <dict> <key>0047E8048E5EE8D208C0B009261D5816</key> <dict> <key>fileRef</key> <string>A1C5C2AA97A78115584DFC22517232F2</string> <key>isa</key> <string>PBXBuildFile</string> </dict> <key>008246B8B3F0ED1F2BCDAC8B0BF9CB2F</key> 

The problem is that I cannot complete my project. And I get this error:

The file 'project.pbxproj' is broken. Cannot find the name PBXProject.

I use Xunique to avoid conflicts, maybe this will help. Please tell me how to handle this. Many thanks!

+7
ios xcode xunique
source share
2 answers

@Lumialxk

Yesterday I had a very similar thing. Just as my project.pbxproj file was in plist format, it differs in that I did not receive the message File 'project.pbxproj' is broken . Instead, a problem arose for me through a merge conflict. Where the conflict was in the project.pbxproj file. There was one conflict, and that was the entire contents of the file. In other words, there were two versions of the file. One on my new branch, where it was in plist format. And one on our base branch, where it was in the usual JSON format. In any case, this is similar to what you see.

It is important to note that both pre-merge branches work with Xcode. Xcode did not seem to have a problem with the project.pbxproj file formatted by plist.

I solved the problem by doing git reset --hard HEAD to discard the merge attempt, this brought me back to the point where I had a branch with the plist project.pbxproj file that I could create and run without problems. Then I selected a random build setting (code signing), changed its value and then changed it (i.e. I just “touched” it to make Xcode change it). Then I built a project. And then reopened the project.pbxproj file in a text editor. After it “touched” the file, it returned to its normal format; there is no longer a plist format.

There was a smooth swim.

Credit comes to my colleague for offering a “sensory” approach.

I am not sure what caused the problem. Here are some details about my setup:

I am running Xcode 7.3 (so I do not think this had anything to do with 7.3.1). I recently upgraded from Cocoapods 0.39.0 to 1.0. I think this is a criminal. I ran into problems when creating some modules with 1.0, which I solved, forcing to use 0.39.0 as follows:

pod _0.39.0_ install
pod _0.39.0_ update

Hope this helps!

+6
source share

Update: This note has also been added to the xUnique README file.

I am the author of xUnique :)

The solution is very simple, you do not need to lower Cocoacpods. just install xcproj :

 brew install xcproj 

The root cause:

Converting the default ASCII pbxproj file to XML format is done by Cocoapods:

Each time CocoaPods creates a Pods.xcodeproj project (when pod update is started) or changes your xcodeproj project application (the first time you install pod), CocoaPods generates a project using XML PLIST, while Xcode usually generates its xcodeproj files

Since CocoaPods 0.24.0 (see CHANGELOG.md, CocoaPods will automatically convert the generated xcodeproj file to ASCII if xcproj is available in PATH.

+2
source share

All Articles