Reputation: 401
I'm having trouble installing CocoaPods. I've already googled for a solution, and followed the answer in How do I select a project in my Podfile? I'm getting the error: Unable to find the Xcode project for the target 'Pods'. Can anyone say what I'm doing wrong?
Michaels-MacBook-Air:~ michael$ cd ~/Documents/Chinese\ Restaurants/
Michaels-MacBook-Air:Chinese Restaurants michael$ pod install
[in /Users/michael]
Analyzing dependencies
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:
xcodeproj 'path/to/Project.xcodeproj'
Michaels-MacBook-Air:Chinese Restaurants michael$ cd ~/Documents/Chinese\ Restaurants/Chinese\ Restaurants.xcodeproj/
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ pod setup
Setting up CocoaPods master repo
Already up-to-date.
Setup completed (read-only access)
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ touch Podfile
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ open -e Podfile
Michaels-MacBook-Air:Chinese Restaurants.xcodeproj michael$ pod install
Analyzing dependencies
[!] Could not automatically select an Xcode project. Specify one in your Podfile like so:
xcodeproj 'path/to/Project.xcodeproj'
Upvotes: 0
Views: 3555
Reputation: 22222
In my case the error was because I had two .xcodeproj
files in my Xcode project.
So the solution was remove the unnecessary .xcodeproj
file and then doing again
pod install
Upvotes: 9
Reputation: 94
Here's solution. In fact the solution has been shown clearly.
Could not automatically select an Xcode project. Specify one in your Podfile like so:
xcodeproj 'path/to/Project.xcodeproj'
I couldn't understand the tips above.Later I got it.
First,you should run the terminal and cd into the directory of your project. Second,type "vim podfile" and run. Third, click button 'i' and change to editing mode. Fourth,now you can type 'xcodeproj projectname.xcodeproj' Then,click ESC and type ':wq'. It means save and quit. In the end,you retype 'pod install' and it will run normally.
Upvotes: 0
Reputation: 401
I tried editing the file in vim, as in https://www.youtube.com/watch?v=9_FbAlq2g9o, and that solved it. Hopefully knowing that is useful to others.
Upvotes: 0