項目中用到的iOSDFULibrary 在xcode8里每次都提示要進行Swift2 ->Swift 3.0的轉(zhuǎn)換,但是每次執(zhí)行pod update,這個庫都沒有更新合陵。難道是Nordic Semiconductor 偷懶嗎氮唯。今天打開 IOS-nRF-Toolbox的github主頁轧简,發(fā)現(xiàn)
The nRF Toolbox is a container app that stores your Nordic Semiconductor apps for Bluetooth Smart in one location.
New in v4.1:
The application is now Fully migrated to Swift3.0
Bugfix: Importing of distribution packets via email no longer crashes
Bugfix: Glucose monitor demo no longer crashes/displays incorrect timestamps when the device uses the 12 hour format locale
Bugfix: Glucose monitor demo no longer duplicates data on the last row when refresh button is tapped
霍膝舅,已經(jīng)更新了啊嗡载,更新之后打開Podfile.lock
use_frameworks!
target "nRF Toolbox" do
pod 'iOSDFULibrary', '~> 2'
pod 'EVReflection', :git => 'https://github.com/evermeer/EVReflection.git', :branch => 'Swift3'
pod 'SWRevealViewController'
pod 'CorePlot', '~> 2.2'
end
修改項目中的Podfile.lock,
命令行執(zhí)行:
pod update --verbose --no-repo-update
報錯:
[!] Unable to satisfy the following requirements:
- `iOSDFULibrary (~> 2)` required by `Podfile`
百度了一下,是找不到符合的版本仍稀,執(zhí)行:
pod search iOSDFULibrary
查詢iOSDFULibrary版本號鼻疮,結(jié)果是
iOSDFULibrary (0.1.11)
This repository contains a tested library for iOS 8+ devices to perform
Device Firmware Update on the nRF5x devices
pod 'iOSDFULibrary', '~> 0.1.11'
- Homepage: https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library
- Source: https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library.git
- Versions: 0.1.11, 0.1.10, 0.1.9, 0.1.8, 0.1.7, 0.1.6, 0.1.5, 0.1.4 [master
repo]
好奇怪,沒有2.0版本琳轿?不應該啊判沟,于是百度pod search 得不到最新版本的原因,發(fā)現(xiàn)了解決辦法 : 這里
- 執(zhí)行
pod repo update
更新本地倉庫崭篡,本地倉庫完成后挪哄,即可搜索到指定的第三方庫,但是我得到的結(jié)果是
Updating spec repo
master
CocoaPods 1.1.0.beta.1 is available.
To update use:gem install cocoapods --pre
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
[!] CocoaPods was not able to update themaster
repo. If this is an unexpected issue and persists you can inspect it runningpod repo update --verbose
這是什么鬼琉闪,更新不了迹炼?我又按提示的,執(zhí)行:pod repo update --verbose
颠毙,結(jié)果是
Updating spec repo
master
$ /usr/bin/git pull --ff-only
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
CocoaPods 1.1.0.beta.1 is available.
To update use:gem install cocoapods --pre
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
[!] CocoaPods was not able to update themaster
repo. If this is an unexpected issue and persists you can inspect it runningpod repo update --verbose
查找無果斯入,也只能放棄了
- 換用下面的方法:升級Cocoapods版本
升級方法:
$ sudo gem update --system
//去掉默認更新源
$ gem sources --remove https://rubygems.org/
//使用淘寶源
$ gem sources -a https://ruby.taobao.org/
$ sudo gem install cocoapods
$ pod setup
但是在gem install cocoa pods
這一步里又出錯了:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
按照stackoverflow里的答案更改為:
sudo gem install -n /usr/local/bin cocoapods
這下就可以啦,接著執(zhí)行:$ pod setup
出現(xiàn)結(jié)果:
Setting up CocoaPods master repo
Performing a deep fetch of themaster
specs repo to improve future performance
下面就是漫長的等待 蛀蜜,可等到最后出現(xiàn):
[!] /usr/bin/git fetch --unshallow
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': transfer closed with outstanding read data remaining
我靠刻两,再次陷入了僵局,又是各種查滴某,有的說是可能只是網(wǎng)絡(luò)原因磅摹。。霎奢。于是我就再試一次户誓,還真好了!
成功了之后幕侠,雖然我檢查版本號并沒有變帝美,但執(zhí)行
pod search iOSDFULibrary
的結(jié)果終于正常了!:
iOSDFULibrary (2.1.2)
This repository contains a tested library for iOS 8+ devices to
perform Device Firmware Update on the nRF5x devices
pod 'iOSDFULibrary', '~> 2.1.2'
- Homepage:
https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library
- Source:
https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library.git
- Versions: 2.1.2, 2.1.1, 2.1, 2.0.1, 2.0, 1.0.12, 1.0.11, 1.0.8,
0.1.11, 0.1.10, 0.1.9, 0.1.8, 0.1.7, 0.1.6, 0.1.5, 0.1.4 [master
repo]
下面就可以愉快的更新庫啦