ios Pod 安装在 cocoapods 版本 1.0.0.beta.1 中显示错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34556991/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Pod install displaying error in cocoapods version 1.0.0.beta.1
提问by Muhammad Nabeel Arif
My podfile was working but after updating to cocoapods version 1.0.0.beta.1
我的 podfile 正在工作,但在更新到 cocoapods 版本 1.0.0.beta.1 后
pod install displays following error
pod install 显示以下错误
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'
回答by Gasper Kolenc
You have to specify a target for each pod.
您必须为每个 pod 指定一个目标。
e.g. if before you had your Podfile written like this:
例如,如果在您将 Podfile 写成这样之前:
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
回答by Karthik damodara
After the new changes to cocoapods, You have to add the following lines to your podfile.
在对 cocoapods 进行新更改后,您必须将以下行添加到您的 podfile 中。
target "YOUR_PROJECT_NAME" do
pod "YOUR_POD"
end
回答by Tr0yJ
From the CocoaPods website:
来自 CocoaPods 网站:
CocoaPods provides a
pod init
command to create a Podfile with smart defaults. You should use it.
CocoaPods 提供了一个
pod init
命令来创建具有智能默认值的 Podfile。你应该使用它。
回答by Phillip
you must add target 'your target' do
and end
around you pod like below.
你必须像下面一样添加target 'your target' do
和end
围绕你的 pod。
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.
另外:您可能需要删除 pods 目录、Podfile.lock 和 xcworkspace 文件,pod install
再次运行。
回答by cooltch
I got the same issue today. For mitigation, I unintall cocoapod, then install again version 0.39.
我今天遇到了同样的问题。为了缓解,我卸载 cocoapod,然后再次安装 0.39 版。
here is the link how to uninstall: https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
这是如何卸载的链接: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.
这个答案不能解决根本原因,但可以让您畅通无阻。我没有足够的声望来发表评论,所以我在这里放了一个答案来解除对你的阻止。
回答by KBVSMJ
I was this operation in the podfile:
我在podfile中是这样操作的:
source 'https://github.com/CocoaPods/Specs.git'
源' https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
平台:ios,'8.0'
target "targetprojectname" do
目标“目标项目名称”做
pod "AFNetworking"
吊舱“AFNetworking”
end
结尾
回答by jungledev
My podfile was formatted correctly, so the answer did not work for me. What I hadto do was all of the following: First,
我的 podfile 格式正确,所以答案对我不起作用。我必须做的是以下所有事情:首先,
- gem uninstall cocoapods
- rvm get stable --auto-dotfiles
- rvm use ruby-2.1.2
- rvm osx-ssl-certs update all
- rvm rubygems latest
- sudo gem sources -r https://rubygems.org/
- sudo gem sources -a http://rubygems.org/
- gem install cocoapods -v 1.0.0.beta.1 --pre -V
- gem卸载cocoapods
- rvm 稳定 --auto-dotfiles
- rvm 使用 ruby-2.1.2
- rvm osx-ssl-certs 更新所有
- rvm rubygems 最新
- 须藤宝石来源 -r https://rubygems.org/
- sudo gem 来源 -a http://rubygems.org/
- 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 thisStack Overflow question helped me finally resolve these issues.
我有 SSL 错误、超时错误和路径错误。这修复了所有这些。我添加这个答案是希望它能帮助某人 - 大多数有这个问题的人不需要完成所有这些步骤,如果不是必要的,不应该这样做。请记住,这是将 d/l 链接更改为不使用 https,因此请确保在解决此问题后将其更改回来。 This, this和thisStack Overflow question帮助我最终解决了这些问题。
回答by Sachin Nikumbh
1) Add and Open Podfilein Xcode instead of TextEdit or any other editor. (Syntax highlighting while viewing a pod file will simplify the process of finding syntax errors)
1)在 Xcode 中添加并打开Podfile而不是 TextEdit 或任何其他编辑器。(查看 pod 文件时突出显示语法将简化查找语法错误的过程)
2) Add project dependancies as follows in your Podfile
2)在你的Podfile中添加如下项目依赖
def pods
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'
end
3) Add above define podsin project targetas follows
3)在项目目标中添加上面定义的pods如下
target 'App_Target_Name' do
pods
end
回答by Anil Gupta
for New version of cocoapods i.i 1.0.1
适用于新版 cocoapods ii 1.0.1
pod 'SlideMenuControllerSwift' pod 'SDWebImage' pod 'SearchTextField'
吊舱'SlideMenuControllerSwift'吊舱'SDWebImage'吊舱'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.
该依赖项SlideMenuControllerSwift
未用于任何具体目标。该依赖项SDWebImage
未用于任何具体目标。该依赖项SearchTextField
未用于任何具体目标。
than i changed it to
比我改成
target "YOUR_PROJECT_NAME" do
目标“YOUR_PROJECT_NAME”
pod "YOUR_POD"
end
结尾
than it worked
比它有效
回答by Bruce Tsai
I have the same problem, and even I changed to
我有同样的问题,甚至我改成了
target "TargetName" do pod 'Alamofire', '~> 3.1.4' pod 'SwiftyJSON', '~> 2.3.2' end
目标“TargetName”做 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.
似乎有一些缓存问题,它总是读取旧版本的 PodFile,即使我删除了 PodFile,也会出现同样的错误。有点奇怪。
However, when I open a new terminal , running pod install, it works.
但是,当我打开一个新终端,运行 pod install 时,它可以工作。