:解決CocoaPods安裝時報的問題,http://ruby.taobao.org/latest_specs.4.8.gz 報404ios
解決 bad response Not Found 404 (http://ruby.taobao.org/latest_specs.4.8.gz)ruby
緣由:淘寶中止基於 HTTP 協議的鏡像服務 須要改用https的協議app
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):ui
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 查看版本號;orm
緣由是podfile升級到最新版本,pod裏的內容必須明確指出所用第三方庫的target;能夠修改Podfile文件的配置文件,讓它兼容不指定固定版本;且又不報錯;ci
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(這個必定要放在文件第一行)以下:rem
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'get
3:不一樣的target引用不一樣的第三方插件it
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開始