pod install says there is no Podfile in the project directory
No Podfile found in the project directoryShort answer
CocoaPods looks for a file named Podfile in the folder where you run the command. If the error appears, either the project has no Podfile yet, or your terminal is in the wrong folder. List the folder first. Run pod init next to the .xcodeproj if the file is missing, or cd to the folder that holds it.
Fix it fast
1Find out which cause you have
List the current folder. You should see your .xcodeproj and a file named exactly Podfile, with no extension.
ls -la2Match what you see, then jump to its fix
What does the error look like?
No Podfile found in the project directory
Cause 1 of 2
The project has no Podfile yet
1Check
A new project, or one that never used CocoaPods, has no Podfile. pod install cannot invent one.
ls -la | grep -i podfile2Fix
Create it with pod init inside the project directory, then add your pods inside the target block that matches your Xcode target name.
pod init
open -e Podfile3Verify
pod install now runs and writes a Pods folder, a Podfile.lock and an .xcworkspace.
pod install
ls -d *.xcworkspaceConfirmed by guides.cocoapods.org
Cause 2 of 2
The terminal is in a different folder than the Podfile
1Check
The Podfile belongs in the project directory, and pod install must be run from there. Search downward for it.
find . -maxdepth 3 -name Podfile -not -path '*/Pods/*'2Fix
Change into the folder that holds the Podfile and run the command again.
cd path/to/folder-with-Podfile
pod install3Verify
The command finds the Podfile and starts resolving dependencies.
pod installConfirmed by guides.cocoapods.org
How do I stop it coming back?
- Commit the Podfile and Podfile.lock next to the .xcodeproj so every clone has them.
- Run CocoaPods commands from the folder that holds the Podfile, not from the repository root by habit.
- Keep the file name exactly Podfile, capital P, no extension.
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
Cannot change the App Privacy answers in App Store Connect
Publish Your App Privacy Responses?
Only the Account Holder, Admin and App Manager roles can answer the App Privacy questions.
2 causes, each with a fixMobile 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 fixMobile apps
You cannot find the button to pull your app back from review
No 'remove this version from review' message appears on the version page
There is no button called Reject Binary.
3 causes, each with a fixMobile apps
Your Apple Account cannot sign in to App Store Connect
Sign-in to App Store Connect is refused for an account that should have access
App Store Connect does not open to every Apple Account.
3 causes, each with a fixMobile apps
Apple rejected the app under Guideline 4.3, Design: Spam
Guideline 4.3(b) - Design - Spam
Guideline 4.3 is Apple's duplicate rule.
5 causes, each with a fixMobile apps
App Store Connect rejects a screenshot because it has transparency
Images can't include alpha channels or transparencies.
App Store Connect does not accept screenshots that carry an alpha channel or transparent pixels.
2 causes, each with a fix