Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Podfile does not contain any dependencies [duplicate]

I'm doing the Ray Wenderlich tutorial called SimpleWeather.
The podfile is in the same folder as the project. Here's my code from the podfile:

platform :ios, '7.0'

xcodeproj 'SimpleWeather'  

pod 'Mantle'  
pod 'LBBlurredImage'  
pod 'TSMessages'  
pod 'ReactiveCocoa'  

The error message is this: [!] Unable to find the Xcode project /Users/myName/Developer/SimpleWeather.xcodeproj for the target Pods.

The name of the project is SimpleWeather.

like image 666
meghan66 Avatar asked Jan 12 '14 03:01

meghan66


People also ask

What does Podfile mean?

~> (the optimistic operator) is used when you want to specify a version 'up to next major | minor | patch'. For example: ~> 0.1.2 will get you a version up to 0.2 (but not including 0.2 and higher)

How do I get rid of Podfile lock?

You should never modify Podfile. lock directly. It's generated by pod install . If you want to remove a Pod, edit Podfile, delete the Pod you want, and rerun pod install .


8 Answers

I'm pretty sure you are not in the right directory. Are you sure your .xcodeproj is in the Developer folder? There might be a subfolder you need to navigate to.

The right way to enable CocoaPods in your Project is:

  1. Open Terminal and execute: $ sudo gem install cocoapods
  2. Navigate to your Project folder (I assume in your case it's cd /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj).
  3. Setup Cocoapod pod setup
  4. Create the Podfile touch Podfile
  5. Open the Podfile open -e Podfile and insert your code for Podfile
  6. Finally install the Podfile pod install

If you follow this instructions everything should work. When opening your project make sure to open the .xworkspacefile.

For more information, see this.

like image 58
fahu Avatar answered Oct 25 '22 18:10

fahu


This error also occurs when you have multiple .xcodeproj in your Xcode project.

You don't need more than one .xcodeproj in general cases. Remove unnecessary .xcodeproj, and Cocoapods should get the correct path automatically afterwards.

like image 22
Brian Avatar answered Oct 25 '22 18:10

Brian


Reiterating our original conversation:

Accordingly to Podfile Syntax Reference the Podfile looks right.

Make sure you are running $pod install from your project directory:

/Users/myName/Developer/SimpleWeather
like image 20
kukido Avatar answered Oct 25 '22 18:10

kukido


Hey your path for the project might be wrong. Go to the project and right click on SimpleWeather.xcodeproj and select Get Info as show in the image below(The right side window is for Get Info here). Copy this path from the details window and paste it into the Podfile. After that append /SimpleWeather.xcodeproj to that pasted path. This might solve the problem(Note: It is a snap shot for my project). In your case the solution might be replacing the path with this /Users/myName/Developer/SimpleWeather/SimpleWeather.xcodeproj

enter image description here

like image 40
Rohan Bhale Avatar answered Oct 25 '22 20:10

Rohan Bhale


To solve this issue, just follow below steps and your issue will get resolved :

Step 1 : Open Terminal and navigate to your project folder

Step 2 : touch podfile

Step 3 : open -e Podfile

Step 4 : Write below line in your text edit and close it

workspace '/Users/systemName/Developer/yourprojectname/yourprojectname.xcworkspace'

Step 5 : Pod install

And after successful process, you will not get this error again.

CheersKP

like image 42
Kalpesh Panchasara Avatar answered Oct 25 '22 18:10

Kalpesh Panchasara


Maybe you have two project .xcodeproj, remove one.

Remove Podfile.lock, folder Pods. On Terminal cd /Users/myName/Developer/SimpleWeather and pod install

like image 23
Yura Huber Avatar answered Oct 25 '22 19:10

Yura Huber


For people who are on Mac and also using code editors, the duplicate file that is causing this issue is ._projectname.xcodeproj because it has the same extension as the regular .xcodeproj files.

like image 27
Sam G Avatar answered Oct 25 '22 18:10

Sam G


I had the same problem. Then with many attempts of trials and errors I finally got the working solution:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target 'SimpleWeather'
pod 'Alamofire', '~> 3.4'

This works when you are in your project directory (I assume you should navigate using terminal to /Users/myName/Developer/SimpleWeather/)

like image 23
pulp Avatar answered Oct 25 '22 19:10

pulp