一: 升級到最新版本
二: cocopod升級到指定版本
三:# Unable to load contents of file list: input/output xcfilelist
一: 升級到最新版本
1、先切換gem源
gem sources --remove https://rubygems.org/
gem source -a http://gems.ruby-china.com
查看是否切換成功
gem source -l
打印出*** CURRENT SOURCES ***
http://gems.ruby-china.com
就說明切換成功,如果還是官方的源, 請手動重啟電腦嘗試
2癞谒、接下來就可以開始升級了cocoapods了
sudo gem install -n /usr/local/bin cocoapods --pre
3、然后敲下
pod --version
4雕拼、剩下的就是設(shè)置pod倉庫了
pod setup
至此, 已經(jīng)升級最新版本了
二: cocopod升級到指定版本
1: 卸載當(dāng)前版本
sudo gem uninstall cocoapods
Select gem to uninstall:
1. cocoapods-1.3.1
2. cocoapods-1.4.0
3. All versions
輸入要刪除的版本
2恋腕、指定版本去安裝(不是很靠譜)
sudo gem install cocoapods -v 1.4.0
輸出:Fetching: cocoapods-1.4.0.gem (100%)
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/pod
3唧领、指定版本去安裝(很靠譜)
sudo gem install -n /usr/local/bin cocoapods -v 1.4.0
4: 查看版本號
pod --version
輸出:1.4.0
三:Unable to load contents of file list: input/output xcfilelist
錯誤的日志
:-1: Unable to load contents of file list: 'xxxxx/Pods/Target Support Files/Pods-xxxxx/Pods-xxxxx-frameworks-Debug-output-files.xcfilelist' (in target 'xxxxx')
前情回顧: 小伙伴們使用的是pod 1.4.0
, 手賤升級到了1.7.1
產(chǎn)生這個問題腕扶。后面講到的減低版本是降到1.4.0
3.1: 方法1 升級pod版本
sudo gem update cocoapods --pre
pod update
clean
build
3.2: 方法2 升級pod版本
1: 降級低版本
2: delete 'Pods/', 'Podfile.lock', 'xxx.xcworkspace'
3: pod deintegrate
4: pod intall
3.3 總結(jié)
出現(xiàn)問題的原因 升級到最新版本1.7.1
, 此時項目的文件對pod的映射關(guān)系會作出調(diào)整增加四個文件
xxxxx/Pods/Target Support Files/Pods-xxxxx/Pods-xxxxx-frameworks-Debug-input-files.xcfilelist
xxxxx/Pods/Target Support Files/Pods-xxxxx/Pods-xxxxx-frameworks-Debug-output-files.xcfilelist
xxxxx/Pods/Target Support Files/Pods-xxxxx/Pods-xxxxx-frameworks-Release-input-files.xcfilelist
xxxxx/Pods/Target Support Files/Pods-xxxxx/Pods-xxxxx-frameworks-Release-output-files.xcfilelist
但是舊版本的pod的執(zhí)行 pod install
不會生成這四個文件
但是項目中已經(jīng)存在對這四個文件的映射關(guān)系孽拷。 此時就無法加載相應(yīng)的文件。因此報錯半抱。
方案1的解決思路是升級pod版本脓恕, 所有的小伙伴都會生成四項文件因此不在報錯
方案2的解決思路是降低到低版本下膜宋, 刪除項目的文件xcworkspace
, 執(zhí)行pod deintegrate
, 移除映射關(guān)系。重新生成新的項目文件炼幔, 此時就解決問題了
三: 安裝cocoapods報錯:Failed to build gem native extension.
(1)
sudo rm -rf /Library/Developer/CommandLineTools
(2)
xcode-select --install
-(3)sudo xcodebuild -license accept
-(4)open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
參考: Unable to load contents of file list: input/output xcfilelist
CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/deprecated_...
CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/deprecated_podspecs.txt, error: Net::OpenTimeout
按照官方文檔在 podfile文件中添加source源:
source 'https://github.com/CocoaPods/Specs.git'