更新CocoaPods1.1.0碰到的问题及知识点

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)

原因:淘宝停止基于 HTTP 协议的镜像服务 需要改用https的协议

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

gem sources -a https://ruby.taobao.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://ruby.taobao.org/
gem sources -l
sudo gem install
-n /usr/local/bin cocoapods

 

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.5)` is not used in any concrete target.
The dependency `AFNetworking (
~> 2.5.4)` is not used in any concrete target.
The dependency `Masonry (
~> 0.6.4)` is not used in any concrete target.
The dependency `JSONModel (
~> 1.2.0)` is not used in any concrete target.
The dependency `JCAlertView (
~> 1.1.5)` is not used in any concrete target.
The dependency `RongCloudIMKit (
= 2.5.2)` 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.4)` is not used in any concrete target.
The dependency `TYAttributedLabel (
~> 2.5.6)` 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都要引用;则要使用link_with(这个一定要放在文件第一行)如下:

link_with ['zxptUser' ,'zxptUser_local', 'zxptUser_AppStore']
platform :ios,
'7.0'
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'

注意基中本工程中有三个target名字,'zxptUser' ,'zxptUser_local', 'zxptUser_AppStore'

 

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开始

转载于:https://my.oschina.net/meloRepository/blog/778531

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值