Cocoapods使用过程中遇到的问题
前言:记录一些在CocoaPods使用过程中遇到的问题,本地环境:Xcode9.0
- 发现有的时候在执行pod init的时候不能正常地创建出来pod File文件,显示的错误如下:
――― MARKDOWN TEMPLATE ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ### Command ```
/Users/wangyongwangyongwang/.rvm/rubies/ruby-2.3./bin/pod init
``` ### Report * What did you do? * What did you expect to happen? * What happened instead? ### Stack ```
CocoaPods : 1.0.
Ruby : ruby 2.3.0p0 (-- revision ) [x86_64-darwin15]
RubyGems : 2.6.
Host : Mac OS X 10.12. (16G29)
Xcode : 9.0 (9A235)
Git : git version 2.10.
Ruby lib dir : /Users/wangyongwangyongwang/.rvm/rubies/ruby-2.3./lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 74d8002565cb1b582426b5affef1b97991b4c14c
``` ### Plugins ```
cocoapods-deintegrate : 1.0.
cocoapods-plugins : 1.0.
cocoapods-search : 1.0.
cocoapods-stats : 1.0.
cocoapods-trunk : 1.0.
cocoapods-try : 1.1.
``` ### Error ```
RuntimeError - [Xcodeproj] Unknown object version.
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3.@global/gems/xcodeproj-1.3./lib/xcodeproj/project.rb::in `initialize_from_file'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3.@global/gems/xcodeproj-1.3./lib/xcodeproj/project.rb::in `open'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3.@global/gems/cocoapods-1.0./lib/cocoapods/command/init.rb::in `validate!'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3.@global/gems/claide-1.0./lib/claide/command.rb::in `run'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3.@global/gems/cocoapods-1.0./lib/cocoapods/command.rb::in `run'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3.@global/gems/cocoapods-1.0./bin/pod::in `<top (required)>'
/Users/wangyongwangyongwang/.rvm/rubies/ruby-2.3./bin/pod::in `load'
/Users/wangyongwangyongwang/.rvm/rubies/ruby-2.3./bin/pod::in `<main>'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./bin/ruby_executable_hooks::in `eval'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./bin/ruby_executable_hooks::in `<main>'
``` ――― TEMPLATE END ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― [!] Oh no, an error occurred. Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%5BXcodeproj%5D+Unknown+object+version.&type=Issues If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md Don't forget to anonymize any private data! wangwang:WWTestCocoaPodsError wangyongwangyongwang$
执行pod init的时候的错误提示
解决问题:根据错误提示可以发现参考 使用CocoaPods出现问题的时候都可以查看CocoaPods issues 我这边的错误是参考的 pod init error #7208
解决方法:关键的命令是这一句:Try gem install cocoapods -v 1.4.0.beta.2
or gem install cocoapods -v 1.3.1
然后就没问题了
插曲:其实我在解决上边问题的时候,第一次忘了输入cocoapods了,然后报错如下
ERROR: While executing gem ... (Gem::CommandLineError)
Please specify at least one gem name (e.g. gem build GEMNAME)
解决办法:后来我正确输入命令没问题后,就解决了这个问题了
自我分析:上边的命令是让我们更新Cocoapods到1.3.1版本,我在更新前都是用的比较老的1.0.1 (pod --version查看安装的Cocoapods的版本)
多想一点CocoaPods的本质到底是什么:
深入理解 CocoaPods 提到CocoaPods 是开发 OS X 和 iOS 应用程序的一个第三方库的依赖管理工具。CocoaPods是用 Ruby 写的,并由若干个 Ruby 包 (gems) 构成的。所以她才会用gem intall 这种方式安装Cocoapods
CocoaPods是这么说自己的:CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. It has over 39 thousand libraries and is used in over 2.7 million apps. CocoaPods can help you scale your projects elegantly.CocoaPods is built with Ruby and is installable with the default Ruby available on OS X. We recommend you use the default ruby.
CocoaPods是对于Swift和Objective-C的Cocoa项目的依赖管理工具,她已有39000多个库,并且应用于27万多个app。CocoaPods可以帮助你使你的项目更小更优雅。CocoaPods的基础是Ruby,并且OS X上默认已经安装了Ruby,我们建议您使用默认的Ruby。
2.在使用pod update --verbose --no-repo-update的时候不能够正常地导入所要导入的第三方库
我要导入的库是 pod 'CYLTabBarController', '~> 1.14.1'
提示的问题是:
Update all pods
Preparing Analyzing dependencies Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target
`Pods-WWCopyHomeWorkBox`: (``)
Using `ARCHS` setting to build architectures of target
`Pods-WWCopyHomeWorkBoxTests`: (``)
Using `ARCHS` setting to build architectures of target
`Pods-WWCopyHomeWorkBoxUITests`: (``) Resolving dependencies of `Podfile`
[!] Unable to satisfy the following requirements: - `CYLTabBarController (~> 1.14.)` required by `Podfile` None of your spec sources contain a spec satisfying the dependency: `CYLTabBarController (~> 1.14.)`. You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile. Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default. /Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/resolver.rb::in `handle_resolver_error'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/resolver.rb::in `rescue in resolve'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/resolver.rb::in `resolve'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/installer/analyzer.rb::in `block in resolve_dependencies'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/user_interface.rb::in `section'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/installer/analyzer.rb::in `resolve_dependencies'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/installer/analyzer.rb::in `analyze'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/installer.rb::in `analyze'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/installer.rb::in `block in resolve_dependencies'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/user_interface.rb::in `section'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/installer.rb::in `resolve_dependencies'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/installer.rb::in `install!'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/command/update.rb::in `run'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/claide-1.0./lib/claide/command.rb::in `run'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./lib/cocoapods/command.rb::in `run'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./gems/cocoapods-1.3./bin/pod::in `<top (required)>'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./bin/pod::in `load'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./bin/pod::in `<main>'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./bin/ruby_executable_hooks::in `eval'
/Users/wangyongwangyongwang/.rvm/gems/ruby-2.3./bin/ruby_executable_hooks::in `<main>'
检查了本地的版本:pod --version
wangwang:WWCopyHomeWorkBox wangyongwangyongwang$ pod --version
1.3.
检查pod 库中是否存在我们要添加的相应的版本的pod库:当我执行pod Search CYLTabBarController的时候显示如下:显示表明 pod 库里边有我要添加的这个版本
wangwang:WWCopyHomeWorkBox wangyongwangyongwang$ pod search CYLTabBarController -> CYLTabBarController (1.14.)
Highly customizable tabBar and tabBarController for iOS
pod 'CYLTabBarController', '~> 1.14.2'
- Homepage: https://github.com/ChenYilong/CYLTabBarController
- Source: https://github.com/ChenYilong/CYLTabBarController.git
- Versions: 1.14., 1.14., 1.14., 1.13., 1.13., 1.13., 1.12., 1.12.,
1.11., 1.10., 1.9., 1.8., 1.7., 1.6., 1.6., 1.6., 1.6., 1.6.,
1.6., 1.6., 1.6., 1.5., 1.5., 1.5., 1.5., 1.5., 1.5., 1.5., 1.4.,
1.4., 1.4., 1.4., 1.4., 1.4., 1.3., 1.3., 1.3., 1.3., 1.2., 1.2.,
1.2., 1.2., 1.2., 1.2., 1.2., 1.2., 1.2., 1.2., 1.1., 1.1., 1.0.,
1.0., 1.0., 1.0., 1.0., 1.0., 1.0., 1.0., 1.0. [master repo] -> CYLTabBarController-JDBR (0.0.)
Highly customizable tabBar and tabBarController for iOS
pod 'CYLTabBarController-JDBR', '~> 0.0.1'
- Homepage: https://github.com/jidibingren/CYLTabBarController
- Source: https://github.com/jidibingren/CYLTabBarController.git
- Versions: 0.0. [master repo]
(END)
最后是直接执行的pod update
然后就下载pod 库(CYLTabBarController)成功了
wangwang:WWCopyHomeWorkBox wangyongwangyongwang$ pod update
Update all pods
Updating local specs repositories
$ /usr/local/bin/git -C /Users/wangyongwangyongwang/.cocoapods/repos/master
fetch origin --progress
remote: Counting objects: , done.
remote: Compressing objects: % (/), done.
remote: Total (delta ), reused (delta ), pack-reused
Receiving objects: % (/), 3.26 MiB | 1.72 MiB/s, done.
Resolving deltas: % (/), completed with local objects.
From https://github.com/CocoaPods/Specs
e1a2033..e327ca5 master -> origin/master
$ /usr/local/bin/git -C /Users/wangyongwangyongwang/.cocoapods/repos/master
rev-parse --abbrev-ref HEAD
master
$ /usr/local/bin/git -C /Users/wangyongwangyongwang/.cocoapods/repos/master
reset --hard origin/master
Checking out files: % (/), done.
HEAD is now at e327ca5 [Add] OptimizelySDKUserProfileService 1.5.-RC
warning: inexact rename detection was skipped due to too many files. CocoaPods 1.4..beta. is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try. For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.4.0.beta.2 Analyzing dependencies
Downloading dependencies
Installing CYLTabBarController (1.14.)
Generating Pods project
Integrating client project [!] Please close any current Xcode sessions and use `WWCopyHomeWorkBox.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is dependency from the Podfile and total pod installed.
先写到这么多,以后再更新;
如有问题,敬请指正;
如需转载,请注明出处,谢谢!
Cocoapods使用过程中遇到的问题的更多相关文章
- CocoaPods安装过程中的大坑
一.CocoaPods是什么? CocoaPods是一个用Ruby写的.负责管理iOS项目中第三方开源库的工具,CocoaPods能让我们集中的.统一管理第三方开源库,为我们节省设置和更新第三方开源库 ...
- cocoapods安装以及使用,安装过程中ruby版本过低
cocoapods安装以及使用,安装过程中ruby版本过低 字数473 阅读103 评论1 喜欢2 1.打开终端 2.移除现有 Ruby 默认源 $ gem sources --remove http ...
- 最新cocoapods安装流程,安装过程中遇到的问题及解决方法
最近重新安装了一次cocoapods,参考的安装流程:http://blog.csdn.net/showhilllee/article/details/38398119/ 但是现在的cocoapods ...
- iOS 学习笔记二【cocopods安装使用和安装过程中遇到的问题及解决办法】【20160725更新】
在osx 10.11之前cocopods问题不多,但是升级到11之后的版本,之前的cocopods大多用不了,需要重新安装,对于我这种使用测试版系统的技术狂来说,每次都需要重新安装很多东西, 当然,c ...
- Cocoapods安装过程
1.升级Ruby环境 gem -v gem update --system 如果没有权限去升级Ruby ?就输入 sudo gem update --system 2.换掉Ruby镜像 首先移除现有的 ...
- iOS cocopods安装使用和安装过程中遇到的问题及解决办法
在osx 10.11之前cocopods问题不多,但是升级到11之后的版本,之前的cocopods大多用不了,需要重新安装,对于我这种使用测试版系统的技术狂来说,每次都需要重新安装很多东西, 当然,c ...
- iOS安装CocoaPods详细过程
iOS安装CocoaPods详细过程 一.简介 什么是CocoaPods CocoaPods是OS X和iOS下的一个第三类库管理工具,通过CocoaPods工具我们可以为项目添加被称为“Pods”的 ...
- WINDOWS系统下MYSQL安装过程中的注意事项
1.首先MySQL的安装方式有两种:一种是MSI安装方式,很简单就像安装Windows软件一样.另外一种就是ZIP安装方式.这种相对而言比较麻烦.新手推荐MSI安装方式. 安装方式有以下两种: MSI ...
- 【转】SQL Server -- 已成功与服务器建立连接,但是在登录过程中发生错误
SQL Server -- 已成功与服务器建立连接,但是在登录过程中发生错误 最近在VS2013上连接远程数据库时,突然连接不上,在跑MSTest下跑的时候,QTAgent32 crash.换成IIS ...
随机推荐
- 51nod 1118 机器人走方格 解题思路:动态规划 & 1119 机器人走方格 V2 解题思路:根据杨辉三角转化问题为组合数和求逆元问题
51nod 1118 机器人走方格: 思路:这是一道简单题,很容易就看出用动态规划扫一遍就可以得到结果, 时间复杂度O(m*n).运算量1000*1000 = 1000000,很明显不会超时. 递推式 ...
- Docker入门之六端口映射与容器互联
一.端口映射 在之前的博客搭建私有仓库时用到这样一句:docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry registry来r ...
- Python数据分析流程
一.数据分析的步骤: 1.查看数据并提出问题 2.数据清洗 3.代码编写,提取出结果数据,并分析是否有异常数据,修改代码 4.根据数据选择合适的图表进行展示 5.根据图表小组讨论交流获得最终的结果 二 ...
- Python selenium 文件自动下载 (自动下载器)
MyGithub:https://github.com/williamzxl 最新代码已经上传到Github,以下版本为stupid版本. 由于在下载过程中需要下载不同文件,所以可以把所有类型放在Va ...
- SAP 条形码
使用系统生成的条形码 正常的排列;将扫描由左到右.旋转对齐将从上到下扫描90度倒立定线将扫描所180度从右到左底部对齐将从底部到顶部270度扫描 但在实际应用中,条形码的大小不仅与此处有关,也与字符格 ...
- winPcap编程之不用回调方法捕获数据包(五 转)
这一次要分析的实例程序跟上一讲非常类似(“打开适配器并捕获数据包”),略微不同的一点是本次将pcap_loop()函数替换成了pcap_next_ex()函数.本节的重点也就是说一下这两个函数之间的差 ...
- thinking in java 随笔
初始化顺序 在一个类里,初始化的顺序是由变量在类内的定义顺序决定的.即使变量定义大量遍布于方法定义的中间,那些变量仍会在调用任何方法之前得到初始化--甚至在构建器调用之前.例如: class Tag ...
- 前端魔法堂——异常不仅仅是try/catch
前言 编程时我们往往拿到的是业务流程正确的业务说明文档或规范,但实际开发中却布满荆棘和例外情况,而这些例外中包含业务用例的例外,也包含技术上的例外.对于业务用例的例外我们别无它法,必须要求实施人员与 ...
- 微信公众号第三方 推送component_verify_ticket协议
整了一天,终于弄明白了 component_verify_ticket 怎么获取的了.在此先批一下微信公众号平台,文档又没写清楚,又没有客服,想搞哪样哈! 好,回归正题. 第一,先通过开发者资质认证, ...
- Bootstrap 引用的标准模板
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...