Cocoapods: "No Xcode project found, please specify one!"

Viewed 43559

Cocoapods is giving me this error message when calling pod init:

[!] No Xcode project found, please specify one

I've...

  1. called sudo gem install cocoapods and waited for it to install
  2. dragged in my project directory folder "Hello" (see images)
  3. called pod init

Here's my desktop:

What my directory folder "Hello looks like (sudo gem install cocoapods has already finished

What happens when I try to initialize the pod.

Why does that happen?

10 Answers

if you are using REACT NATIVE or FLUTTER ,make sure go to ios folder ,then pod init

cd ios
pod init

Just close the XCode and terminal once then restart the Terminal. Make sure you select the path to your project folder only.

After calling cd /Users/YOUR_USER_NAME/Desktop/PROJECT_NAME just call a command ~ls and check if the list of the file contains your PROJECT_NAME.xcodeproj. If this file is available, it means you can now set up pod init. Otherwise, you should navigate to the next level and find your PROJECT_NAME.xcodeproj.

Hope it helps! :)

Make sure that you are in the correct directory where you .xcodeproj is located.

I had the same issue and the problem was because of the space in the directory name. I could see on the Desktop there was no space in the directory name, but in Finder, there was a space in the name. After closing out of XCode and then renaming the folder to have no spaces the issue was solved and 'pod init' worked fine.

My solution:

  1. called sudo gem install cocoapods and waited for it to install
  2. pod setup
  3. dragged in my project directory folder "Hello"
  4. called pod init

https://www.jianshu.com/p/a3b803457b08

It's working for me.

It's working for me .

first import directory in terminal where your .xcodeproj .

then run pod init it's showing error ([!] No Xcode project found, please specify one)...then run pod install command .. Again it is showing error ([!] NoPodfile' found in the project directory.)`..

then QUIT terminal .. Open again ...

import directory in terminal again Run command pod init ..

Now working fine.

Rename the projectFolder to 7, Project folder should have the same name as the .xcodeproj file has.

Might as well add my 2 cents. I just installed xcode and react native, following this guide: https://dev.to/rob117/how-to-really-set-up-a-react-native-environment-on-mac-248h

Everything seemed to run as expected at first with react-native run-ios...I copied over some react-native files from another project, got some dependency errors, fixed them with npm install, and then I restarted my MacBook. After I booted up again, I ran react-native run-ios and got errors about not being able to launch the iPhone 6 simulator. I couldn't find a fix, so I decided to determine if it was my code or if it was xcode or what. So I went to my main projects directory and started a new react-native project, referencing the link I posted above. After everything installed, I did react-native run-ios again and boom, everything worked fine.

So then I closed xcode, the simulator and the terminal that runs upon starting react-native. I went back to my first project and ran react-native run-ios. boom it's working again, except this strange error error Could not find the following native modules: RNKeychain, RNVectorIcons. Did you forget to run "pod install" ?. I installed cocoapods via brew the first time around, I tried pod install but it complains about no xcode file or something. I've tried pod init, but it tells me No Xcode project found, please specify one. I ran pod setup, no error...seemed to do nothing? I guess it's working because now my simulator is running again.

Maybe I'll just remove the react-native-keychain and react-native-vectoricons npm packages from my package.json and see if it goes away. I don't really understand what coca pods is or why I need it. I'm thinking maybe you should take some time to update xcode, delete node_modules folder and run npm install again, spin up a new react-native project and if it works close xocde, simulator and the terminal and then try to go run your project again.

If it was working fine before and you didn't update anything outside of node_modules folder, remove and reinstall often works for me.

Good luck

I am using ionic, you need to cd to the directory that contains xcode files like (App.xcodeproj + App.xcworkspace) then apply the command

pod init

Related