Pod install displaying error in cocoapods version 1.0.0.beta.1

你说的曾经没有我的故事 提交于 2019-11-28 02:58:08

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
Karthik damodara

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

From the CocoaPods website:

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

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.

cooltch

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.

I was this operation in the podfile:

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

platform :ios, '8.0'

target "targetprojectname" do

pod "AFNetworking"

end

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.

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.

Sachin Nikumbh

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

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

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
platform :ios, '8.0'
target 'YourTargetName' do

  ALL PODS HERE

end

open terminal, go to project folder and enter code

pod update
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!