177

My podfile was working but after updating to cocoapods version 1.0.0.beta.1

pod install displays following error

MacBook-Pro:iOS-TuneIn home$ pod install
Fully deintegrating due to major version update
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
Deleted 1 'Embed Pods Frameworks' build phases.
- libPods.a
- Pods.debug.xcconfig
- Pods.release.xcconfig
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
- libPods.a
Deleted 1 empty `Pods` groups from project.
Removing `Pods` directory.

Project has been deintegrated. No traces of CocoaPods left in project.
Note: The workspace referencing the Pods project still remains.
Updating local specs repositories
Analyzing dependencies
[!] The dependency `AFNetworking (= 2.6.3)` is not used in any concrete target.
The dependency `MBProgressHUD (~> 0.9.1)` is not used in any concrete target.
The dependency `PDKeychainBindingsController (~> 0.0.1)` is not used in any concrete target.
The dependency `FMDB/SQLCipher` is not used in any concrete target.
The dependency `ZXingObjC (~> 3.1.0)` is not used in any concrete target.
The dependency `SDWebImage (~> 3.7.2)` is not used in any concrete target.
The dependency `SignalR-ObjC (~> 2.0.0.beta3)` is not used in any concrete target.
The dependency `CJPAdController (from `https://github.com/nabeelarif100/CJPAdController.git`)` is not used in any concrete target.
The dependency `ECSlidingViewController (~> 2.0.3)` is not used in any concrete target.
The dependency `VGParallaxHeader` is not used in any concrete target.
The dependency `EMString` is not used in any concrete target.
The dependency `Google/SignIn` is not used in any concrete target.
The dependency `VIPhotoView (~> 0.1)` is not used in any concrete target.
The dependency `EncryptedCoreData (from `https://github.com/project-imas/encrypted-core-data.git`)` is not used in any concrete target.
MacBook-Pro:iOS-TuneIn home$ 

Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'AFNetworking', '2.6.3'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'PDKeychainBindingsController', '~> 0.0.1'
pod 'FMDB/SQLCipher'
pod 'ZXingObjC', '~> 3.1.0'
pod 'SDWebImage', '~>3.7.2'
pod 'SignalR-ObjC','~>2.0.0.beta3'
pod 'CJPAdController', :git => 'https://github.com/nabeelarif100/CJPAdController.git'
pod 'ECSlidingViewController', '~> 2.0.3'
pod 'VGParallaxHeader'
pod 'EMString'
pod 'Google/SignIn'
pod 'VIPhotoView', '~> 0.1'
pod 'EncryptedCoreData', :git => 'https://github.com/project-imas/encrypted-core-data.git'
Muhammad Nabeel Arif
  • 19,140
  • 8
  • 51
  • 70

12 Answers12

498

You have to specify a target for each pod.

e.g. if before you had your Podfile written like this:

pod 'Alamofire', '~> 3.1.4'
pod 'SwiftyJSON', '~> 2.3.2'

just change it to

target "TargetName" do
    pod 'Alamofire', '~> 3.1.4'
    pod 'SwiftyJSON', '~> 2.3.2'
end
Gasper
  • 5,679
  • 1
  • 18
  • 21
57

After the new changes to cocoapods, You have to add the following lines to your podfile.

target "YOUR_PROJECT_NAME" do

     pod "YOUR_POD"

end
itsji10dra
  • 4,603
  • 3
  • 39
  • 59
Karthik damodara
  • 1,805
  • 19
  • 17
19

From the CocoaPods website:

CocoaPods provides a pod init command to create a Podfile with smart defaults. You should use it.

Tr0yJ
  • 3,274
  • 1
  • 22
  • 30
9

you must add target 'your target' do and end around you pod like below.

target 'your target' do
pod 'AFNetworking', '2.6.3'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'PDKeychainBindingsController', '~> 0.0.1'
end

plus: You may be need remove the pods dir, Podfile.lock and xcworkspace file, run the pod install again.

Phillip
  • 801
  • 10
  • 13
  • I also needed to delete the Podfile.lock and other files. When I just added target 'your target' do and end, the installation succeeded but did not update the file version - just reinstalled the previous version. After deleting the Podfile.lock and other files, the most updated files were installed. – user3000868 Sep 12 '16 at 13:19
3

I got the same issue today. For mitigation, I unintall cocoapod, then install again version 0.39.

here is the link how to uninstall: https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine

This answer does not fix the root cause, but can get you unblocked. I don't have enough reputation to leave comments, so I put an answer here to unblock you.

Community
  • 1
  • 1
cooltch
  • 179
  • 2
  • 7
  • A good reference but you should have also mentioned the steps just in case the reference is taken down some day. – UsamaMan Feb 10 '16 at 12:15
2

I was this operation in the podfile:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'

target "targetprojectname" do

pod "AFNetworking"

end

KBVSMJ
  • 39
  • 3
1

My podfile was formatted correctly, so the answer did not work for me. What I had to do was all of the following: First,

  1. gem uninstall cocoapods
  2. rvm get stable --auto-dotfiles
  3. rvm use ruby-2.1.2
  4. rvm osx-ssl-certs update all
  5. rvm rubygems latest
  6. sudo gem sources -r https://rubygems.org/
  7. sudo gem sources -a http://rubygems.org/
  8. gem install cocoapods -v 1.0.0.beta.1 --pre -V

I had SSL errors, timeout errors, and path errors. This fixed all of these. I am adding this answer in hopes that it will help someone - most people with this issue will NOT need to go through all of these steps, and should not do so if it is not neccesary. Keep in mind, that this is changing the d/l link to not use https, so be sure to change it back once you have resolved this issue. This, this, and this Stack Overflow question helped me finally resolve these issues.

jungledev
  • 4,195
  • 1
  • 37
  • 52
0

I have the same problem, and even I changed to

target "TargetName" do pod 'Alamofire', '~> 3.1.4' pod 'SwiftyJSON', '~> 2.3.2' end

It seems has some cache problem, it always read old version of PodFile, even I remove PodFile, the same error show up. It's weird.

However, when I open a new terminal , running pod install, it works.

Bruce Tsai
  • 1,440
  • 2
  • 12
  • 18
0

1) Add and Open Podfile in Xcode instead of TextEdit or any other editor. (Syntax highlighting while viewing a pod file will simplify the process of finding syntax errors)

2) Add project dependancies as follows in your Podfile

def pods
  pod 'AFNetworking', '~> 2.6'
  pod 'ORStackView', '~> 3.0'
  pod 'SwiftyJSON', '~> 2.3'
end

3) Add above define pods in project target as follows

target 'App_Target_Name' do
  pods
end
Gibron
  • 1,350
  • 1
  • 9
  • 28
Sachin Nikumbh
  • 911
  • 11
  • 11
0

for New version of cocoapods i.i 1.0.1

pod 'SlideMenuControllerSwift' pod 'SDWebImage' pod 'SearchTextField'

I was getting error:

The dependency SlideMenuControllerSwift is not used in any concrete target. The dependency SDWebImage is not used in any concrete target. The dependency SearchTextField is not used in any concrete target.

than i changed it to

target "YOUR_PROJECT_NAME" do

 pod "YOUR_POD"

end

than it worked

Anil Gupta
  • 1,155
  • 1
  • 19
  • 26
0

Pod file is just a ruby file, you need to specify required pod for all target. one of the available solution is to define all required pods in shared_pos, and use that for each target.

For ex:

Podfile

platform :ios, '9.0'

use_frameworks!

def Shared_Pods
    pod 'Quick', '0.5.0'
    pod 'Nimble', '2.0.0-rc.1'
end

target 'MyMainTarget' do
    Shared_Pods
end

target 'MyUITests' do
    Shared_Pods
end
PlusInfosys
  • 3,416
  • 1
  • 19
  • 33
0
platform :ios, '8.0'
target 'YourTargetName' do

  ALL PODS HERE

end

open terminal, go to project folder and enter code

pod update
ali ozkara
  • 5,425
  • 2
  • 27
  • 24