iOS pod init 报错
今天新建立項目加入pod,執行pod init報錯,錯誤如下
?
?
[!] Oh no, an error occurred.
?
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%5BXcodeproj%5D+Unknown+object+version.&type=Issues
?
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
?
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
?
Don't forget to anonymize any private data!
?
Looking for related issues on cocoapods/cocoapods...
- Pod Update: RuntimeError - [Xcodeproj] Unknown object version. Xcode Beta 5
?? https://github.com/CocoaPods/CocoaPods/issues/8003 [closed] [17 comments]
?? 3 days ago
?
- RuntimeError - [Xcodeproj] Unknown object version.
?? https://github.com/CocoaPods/CocoaPods/issues/7697 [closed] [28 comments]
?? 3 weeks ago
?
- Pod init. Unknown object version
?? https://github.com/CocoaPods/CocoaPods/issues/7907 [closed] [2 comments]
?? 03 Jul 2018
?
and 42 more at:
https://github.com/cocoapods/cocoapods/search?q=[Xcodeproj]%20Unknown%20object%20version.&type=Issues&utf8=?
MacBook-Pro-2:swift_grammer_one sunqiujing$ pod repo remove master
?
?
?
Removing spec repo `master`
?
?
^Z
[3]+? Stopped ? ? ? ? ? ? ? ? pod repo remove master
?
?
?
這是因為升級了macOS 的系統,導致cocoapods不能使用.
當你的Mac系統升級為 high sierra 的時候,別忘記更新cocoapods.
執行命令為:
$ sudo gem update --system $ sudo gem install cocoapods -n/usr/local/bin以上基本問題可以解決了.
再次更新,會出現下面界面,說明成功:
參考指令
1、更新gem:sudo gem update --system
2、刪除gem源:gem sources --remove [https://ruby.taobao.org/](https://ruby.taobao.org/)
3、修改gem源:gem sources -a [https://gems.ruby-china.org](https://gems.ruby-china.org/)
4、查看gem源是否是最新的:gem sources -l
5、升級cocoapods:sudo gem install -n/usr/local/bin cocoapods --pre
6、查看升級后的cocoapods版本:pod --version
?
總結
以上是生活随笔為你收集整理的iOS pod init 报错的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java常见证书类型和密钥库类型
- 下一篇: iOS 不要用文本编辑pod file