Project /Users/X/Desktop/X/X.xcodeproj cannot be opened because it is missing its project.pbxproj file

When trying to setup the source control feature in Xcode in an existing project, I changed branch to the one situated at github, but as I did that all my code disappeared an now I am not able to open the project as it says cannot be opened because it is missing its project.pbxproj file. Can I somehow switch back to my local master branch and recover my project? :(

Upvotes: 4

Views: 6377

Answers (2)

software evolved
software evolved

Reputation: 4342

For me, neither the issue or solution had anything to do with a source control repository. Somehow the project folder permissions got screwed up. To fix it, I opened the folder containing the project, did "Get Info..", clicked on the lock to unlock it, clicked on the gear icon near the bottom of the pane, and selected "Apply to enclosed items..." This reset the permissions throughout the project folder, after which I could open the project.

Upvotes: 3

Brad Allred
Brad Allred

Reputation: 7534

What has happened here is that you checked out a branch that does not contain the xcode project (or at least not all its components).

yes, you can switch back to the master branch and have everything that is in master including the project (assuming it was committed prior to master)

considering your problem you may need to use terminal to checkout master. in that case open terminal and cd to the project directory and do git checkout master

Upvotes: 2

Related Questions