1:解决CocoaPods安装时报的问题,http://ruby.taobao.org/latest_specs.4.8.gz 报404

解决 bad response Not Found 404 (http://ruby.taobao.org/latest_specs.4.8.gz)

原因:淘宝的那个镜像(https://ruby.taobao.org/ )已经不可用了。所以我们现在用最新支持的ruby镜像(https://gems.ruby-china.org/)

gem sources --remove https://ruby.taobao.org/

gem sources -a https://gems.ruby-china.org/

gem sources -l

sudo gem install -n /usr/local/bin cocoapods

当然如果你是第一次安装时(目前网上有些安装资料可能还指向淘宝的http):

gem sources -l
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.org/
gem sources -l
sudo gem install -n /usr/local/bin cocoapods

1.1

$ gem sources -l  (用来检查使用替换镜像位置成功)

1.2 报证书错误

$ gem sources -a https://gems.ruby-china.org/

ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20)

ERROR:  You must add /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority to your local trusted store

ERROR:  SSL verification error at depth 2: self signed certificate in certificate chain (19)

ERROR:  Root certificate is not trusted (/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA)

https://gems.ruby-china.org/ added to sources

解决方式:

$ sudo curl -O http://curl.haxx.se/ca/cacert.pem

$ sudo mv cacert.pem cert.pem

1.3:当pod update时卡在Setting up CocoaPods master repo 就更新一下ruby

淘宝的那个镜像(https://ruby.taobao.org/ )已经不可用了。所以我们现在用最新支持的ruby镜像(https://gems.ruby-china.org/)
  需要的命令行:
$ gem sources -r https://rubygems.org/ (移除旧版本的镜像,如果你不知道你电脑上目前用的是什么镜像,可用  $ gem sources -l  来查看)
 
$ gem sources -a https://gems.ruby-china.org/ (增加可用的镜像)
 
$ gem sources -l  (用来检查使用替换镜像位置成功)

2:CocoaPods更新版本后,安装跟更新第三方报错

Update all pods
Re-creating CocoaPods due to major version update.
Updating local specs repositories
Analyzing dependencies
[!] The dependency `ReactiveCocoa (~> 2.5)` is not used in any concrete target.
The dependency `SDWebImage (~> 3.7.)` is not used in any concrete target.
The dependency `AFNetworking (~> 2.5.)` is not used in any concrete target.
The dependency `Masonry (~> 0.6.)` is not used in any concrete target.
The dependency `JSONModel (~> 1.2.)` is not used in any concrete target.
The dependency `JCAlertView (~> 1.1.)` is not used in any concrete target.
The dependency `RongCloudIMKit (= 2.5.)` is not used in any concrete target.
The dependency `SMPageControl (~> 1.2)` is not used in any concrete target.
The dependency `FMDB` is not used in any concrete target.
The dependency `GTSDK` is not used in any concrete target.
The dependency `BaiduMapKit` is not used in any concrete target.
The dependency `UMengAnalytics-NO-IDFA` is not used in any concrete target.
The dependency `Fabric` is not used in any concrete target.
The dependency `Crashlytics` is not used in any concrete target.
The dependency `CocoaLumberjack` is not used in any concrete target.
The dependency `TTTAttributedLabel` is not used in any concrete target.
The dependency `FLEX` is not used in any concrete target.
The dependency `GVUserDefaults` is not used in any concrete target.
The dependency `UMengFeedback (~> 2.3.)` is not used in any concrete target.
The dependency `TYAttributedLabel (~> 2.5.)` is not used in any concrete target.
The dependency `IQKeyboardManager` is not used in any concrete target.
The dependency `MWPhotoBrowser` is not used in any concrete target.

可以通过 $ pod --version 查看版本号;

原因是podfile升级到最新版本,pod里的内容必须明确指出所用第三方库的target;可以修改Podfile文件的配置文件,让它兼容不指定固定版本;且又不报错;

platform :ios, '7.0'

target 'zxptUser’ do

pod 'ReactiveCocoa', '~> 2.5'
pod 'SDWebImage', '~> 3.7.5'
pod 'AFNetworking', '~> 2.5.4'
pod 'Masonry', '~> 0.6.4'
pod 'JSONModel', '~> 1.2.0'
pod 'JCAlertView', '~> 1.1.5'
pod 'RongCloudIMKit', '2.5.2' #不要更新此库 源代码已被修改
pod 'SMPageControl', '~> 1.2'
pod 'FMDB'
pod 'GTSDK'
pod 'BaiduMapKit' #百度地图SDK
pod 'UMengAnalytics-NO-IDFA'#友盟统计无IDFA版SDK
pod 'Fabric'
pod 'Crashlytics'
pod 'CocoaLumberjack'
pod 'TTTAttributedLabel'
pod 'FLEX'
pod 'GVUserDefaults'
pod 'UMengFeedback', '~> 2.3.4'
pod 'TYAttributedLabel', '~> 2.5.6’
pod 'IQKeyboardManager'
pod 'MWPhotoBrowser' end

其中zxptUser要换成当前target名,最后不要忘记增加一个end结尾,当然如果你的工程是有多个target都要引用;如下:

abstract_target 'defaults' do

platform :ios, '7.0'

pod 'AFNetworking', '~>2.5.0'

pod 'ReactiveCocoa', '~> 2.5'

pod 'JSONModel', '~> 1.0.1'

pod 'Masonry','~>0.6.1'

pod 'FMDB/common' , '~>2.5'

pod 'FMDB/SQLCipher', '~>2.5'

pod 'CocoaLumberjack', '~> 2.0.0-rc'

pod 'SVPullToRefresh', '~> 0.4.1'

pod 'GTSDK','1.4.3'

pod 'RongCloudIMKit', '2.6.7'

pod 'UMengSocialCOM', '5.2.0'

pod 'RealReachability'

target 'Blossom'

end

target 'Blossom_test'

end

target 'Blossom_bls'

end

target 'Blossom_dongguan'

end

target 'Blossom_qijia'

end

target 'Blossom_shanghai'

end

target 'Blossom_zhengzhuang_test'

end

target 'Blossom_bls_test'

end

end

注意基中'defaults'一定不要存在,下面记得写target,可以查看官网的写法:https://guides.cocoapods.org/using/the-podfile.html

3:不同的target引用不同的第三方插件

target :'zxptUser' do
platform :ios
pod 'Reachability', '~> 3.0.0'
pod 'SBJson', '~> 4.0.0' platform :ios, '7.0'
pod 'AFNetworking', '~> 2.0'
end target :'zxptUser_local' do
pod 'OpenUDID', '~> 1.0.0'
end

注意每个都要以end结尾

4:删除CocoaPods版本,并安装指定版本

比如我本来安装完CocoaPods 1.0.0版,但发现它实现跟先前还是差别满大的,决定降回0.39这个比较稳定版本;就可以用命令先删除本地的CocoaPods版本,再指定安装特定版本;

a 卸载 cocoapods(它会提示你要删除本地哪个版也可以全删)

sudo gem uninstall cocoapods

b 安装 0.39版本

sudo gem install -n /usr/local/bin cocoapods -v 0.39

5:更新PODS后,报diff: /../Podfile.lock: No such file or directory 错误

diff: /../Podfile.lock: No such file or directory

diff: /Manifest.lock: No such file or directory

error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

如图

解决办法:

查看工程中PROJECT中Configurations中相关配置是否正准,有可能某个分枝指到一个不存在的pods导致;

6:当PODS引入第三方后,项目中引用时发现头文件却显示不存在

排查办法,可以看到相应的targets里面的Build Phases中的Link Binary WithLibraries里面是否有把libPods.a库引入进来

一般出现没有引入进来可能是podFile指定的相应Targets导致其它的Targets没有这个库;

7:友盟最新版SDK调整

a:#import“MobClick.h”引入头文件由原来,更新为:#import "UMMobClick/MobClick.h"

b:初始化配置文件也进行更改,采用UMConfigInstance全局变量设置:

    UMConfigInstance.appKey=kUMAnalyticsAppKey;
UMConfigInstance.channelId=@"App Store";
[MobClick startWithConfigure:UMConfigInstance];

8:关于融云跟百度地图支持IPV6

融云SDK 从2.5.2开始   百度地图SDK 从3.0.0开始

最近有个妹子弄的一个关于扩大眼界跟内含的订阅号,每天都会更新一些深度内容,在这里如果你感兴趣也可以关注一下(嘿对美女跟知识感兴趣),当然可以关注后输入:github 会有我的微信号,如果有问题你也可以在那找到我;当然不感兴趣无视此信息;


更新CocoaPods碰到的问题及知识点的更多相关文章

  1. xcode8 更新cocoapods

    一.升级ruby环境,由于目前淘宝Ruby镜像升级有问题,所以使用了 http://rubygems-china.oss.aliyuncs.com 二.需要操作的步骤: 1.检查你的ruby源,终端输 ...

  2. 20161206日更新CocoaPods版本

    从网上下载的工程第三方库需要更新,但当我执行pod update时提示以下错误: [!] The `master` repo requires CocoaPods 1.0.0 -  (currentl ...

  3. 安装cocoapods以及更新cocoapods

    安装 1.设置ruby的软件源 这是因为ruby的软件源rubygems.org因为使用亚马逊的云服务,被我天朝屏蔽了,需要更新一下ruby的源,过程如下: gem sources -l #(查看当前 ...

  4. 更新CocoaPods

    终端输入 : sudo gem install -n /usr/local/bin cocoapods –pre 更新了CocoaPods后,在原来的工程中执行了pod install命令后,报这样的 ...

  5. 【iOS】更新 CocoaPods 后 Podfile 报错

    更新了 CocoaPods 后,再执行 "pod install" 时报了如下错误: [!] The dependency `AFOnoResponseSerializer` is ...

  6. uni-app 的更新及碰到的问题

    uni-app 的更新 我这个是针对 app 的测试,没有考虑 小程序 及 h5,如需考虑请参考 uni-app 的条件编译 当我们将文件打包好之后,我们在手机上就可以下载 apk 文件,安装到我们的 ...

  7. 使用cocoapods碰到的难题

    -------------报错---------- 1. git clone error: RPC failed; result=56, HTTP code = 200 解决办法: git confi ...

  8. Xcode8更新CocoaPods报错解决办法

    Apple发布了iPhone7同时也发布了xcode8,第一时间升级,并且用Xcode8集成cocoapods但是打开工程,会报一大堆错误解决这个问题
由于OSX的安全解决方案,所以默认路径不能安装, ...

  9. 安装CocoaPods碰到的问题

    1.安装完Pods后第一次使用pod install命令提示"Setting up CocoaPods master repo" 解决办法: 第一次使用pod命令时,先执行以下po ...

随机推荐

  1. Git学习笔记(三)

    一.标签是什么 发布一个版本时,我们通常先在版本库中打一个标签,这样,就唯一确定了打标签时刻的版本.将来无论什么时候,取某个标签的版本,就是把那个打标签的时刻的历史版本取出来.所以,标签也是版本库的一 ...

  2. C#:基于WMI查询USB设备信息 及 Android设备厂商VID列表

    /* ---------------------------------------------------------- 文件名称:WMIUsbQuery.cs 作者:秦建辉 MSN:splashc ...

  3. 【C#】在窗体中水平居中的控件,到了XP下不居中的解决办法

    我时不时会遭遇这个操蛋问题,今天得闲研究了一下,解决如下: A.将窗体FormBorderStyle属性改为Fixed系,当然这会导致用户不能拖拉窗口大小,所以你可能需要B计划↓ B.确保在[VS]中 ...

  4. C#编程总结(十)字符转码

    C#编程总结(十)字符转码 为了适应某种特殊需要,字符需要根据规则进行转码,便于传输.展现以及其他操作等. 看看下面的转码,就知道他的用处了. 1.字符串转码 根据原编码格式与目标编码格式,完成转换. ...

  5. 15天玩转redis —— 第四篇 哈希对象类型

    redis中的hash也是我们使用中的高频数据结构,它的构造基本上和编程语言中的HashTable,Dictionary大同小异,如果大家往后有什么逻辑需要用 Dictionary存放的话,可以根据场 ...

  6. Android文件的分割和组装

    使用UDP数据包发送文件时,由于UDP数据包大小的限制,一个文件要放在几个UDP数据包里面发送,这就需要把一个文件分割成若干部分,分别放进若干个UDP数据包里面,在接收端,收到这些UDP数据包以后,再 ...

  7. 第 12 章 CSS 入门

    学习要点: 1.使用 CSS 2.三种方式 3.层叠和继承 主讲教师:李炎恢 本章主要探讨 HTML5 中 CSS(层叠样式表),它是用来对 HTML 文档外观的表现形式进行排版和格式化. 一.使用 ...

  8. 代码设置Shape和Selector

    开发中经常需要使用Shape和Selector,如果每个都用xml设置的话,会占用apk大小,同时命名多了也会混乱,使用代码来设置会方便很多. 需要用到2个类:GradientDrawable和Sta ...

  9. MySQL高效分页解决方案集(转)

    很久以前的一次面试中,被面试官问到这个问题,由于平时用到的分页方法不多,只从索引.分表.使用子查询精准定位偏移以外,没有使用到其它方法. 后来在看其它博客看到了一些不同的方案,也一直没有整理.今天有时 ...

  10. Insight API开源项目介绍

           首先,在阅读本文以前假设您已经了解比特币Bitcoin基本原理. Insight API是一个开源基于比特币Bitcoin  blockchain的REST风格的API框架.Insigh ...