Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Xcode will not open the project: the .xcodeproj has no project.pbxproj

ErrorProject MyApp.xcodeproj cannot be opened because it is missing its project.pbxproj file

Short answer

An .xcodeproj is a folder, and Xcode reads the project.pbxproj file inside it to open the project. If that file is not on disk, Xcode refuses to open it. In a Git project the cause is one of three: a commit deleted the file, a .gitignore rule kept it out, or a tool such as XcodeGen is meant to generate it.

  • Applies to Xcode 26, Git, XcodeGen
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Look inside the .xcodeproj folder, ask Git whether a rule ignores the file, and see whether the repository has a project.yml. The three answers point to the three causes.

    ls -la MyApp.xcodeproj
    git check-ignore -v MyApp.xcodeproj/project.pbxproj
    ls project.yml
  2. 2Match what you see, then jump to its fix

    1. 1The folder exists, project.pbxproj is not in it, and no ignore rule matchesA commit, merge or checkout removed the fileFix
    2. 2git check-ignore -v prints a line naming a pattern, and a fresh clone has an .xcodeproj without the fileA .gitignore rule kept project.pbxproj out of the repositoryFix
    3. 3The repository has a project.yml and a README or team rule that the .xcodeproj is not committedThe project is generated by XcodeGen and was never generated hereFix

What does the error look like?

  • Project MyApp.xcodeproj cannot be opened because it is missing its project.pbxproj file
  • ls: MyApp.xcodeproj/project.pbxproj: No such file or directory

Cause 1 of 3

A commit, merge or checkout removed the file

1Check

Search the history for the commit that deleted the file. git log can be limited to one path, and --diff-filter=D keeps only commits that deleted a file.

git log --diff-filter=D --name-status -- MyApp.xcodeproj/project.pbxproj

2Fix

Restore the file from the commit just before the deletion. If the file is only missing in your working tree and still exists in the index, git restore without --source brings it back.

git restore --source=<deleting-commit>~1 -- MyApp.xcodeproj/project.pbxproj
# missing only in the working tree:
git restore MyApp.xcodeproj/project.pbxproj

3Verify

The file is back on disk and Xcode opens the project.

ls -l MyApp.xcodeproj/project.pbxproj
open MyApp.xcodeproj

Confirmed by git-scm.com

Did this fix it?

Cause 2 of 3

A .gitignore rule kept project.pbxproj out of the repository

1Check

git check-ignore -v prints the source file, line number and pattern that match the path. A pattern that is too wide, such as one that ignores everything inside *.xcodeproj, hides project.pbxproj.

git check-ignore -v MyApp.xcodeproj/project.pbxproj

2Fix

Narrow or remove the pattern the command printed. Then take the file from the machine that still has the project, commit it, and clone again to confirm.

# in the .gitignore file named by the output, delete or narrow the matching line
# then copy project.pbxproj into MyApp.xcodeproj/ from the working machine

3Verify

The command prints nothing for the path, because the file is no longer ignored.

git check-ignore -v MyApp.xcodeproj/project.pbxproj; echo "exit code: $?"

Confirmed by git-scm.com

Did this fix it?

Cause 3 of 3

The project is generated by XcodeGen and was never generated here

1Check

XcodeGen builds the Xcode project from a spec file called project.yml in the current directory. It lets teams keep the .xcodeproj out of Git, so a fresh clone has nothing to open until you generate it.

ls project.yml

2Fix

Install XcodeGen with Homebrew and generate the project in the folder that holds project.yml.

brew install xcodegen
xcodegen generate

3Verify

MyApp.xcodeproj now contains project.pbxproj and opens in Xcode.

ls -l MyApp.xcodeproj/project.pbxproj
open MyApp.xcodeproj

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Keep the ignore rules for Xcode narrow (user data and build folders) and never ignore project.pbxproj in a project that is not generated.
  • In a generated project, write down in the README that xcodegen generate is the first step after cloning.
  • Review deletions in a merge before you commit it, and look at the file list for the .xcodeproj folder.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Mobile apps

App record creation fails because you lack permission

You cannot add a new app in App Store Connect as a Developer or limited user

Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.