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 ins
My podfile was formatted correctly, so the answer did not work for me. What I had to do was all of the following: First,
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.
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:
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
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
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
From the CocoaPods website:
CocoaPods provides a
pod init
command to create a Podfile with smart defaults. You should use it.
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