iOS pod init 报错 RuntimeError - [

2021-12-13  本文已影响0人  MQ_Twist

不出意外的话,马上就要出意外了。

前言

自己开发过程中就习惯记录下来的疑问点和可优化的点,然后在空闲的时候就挨个处理它们,这不,还没开始就遇到问题了。

正文

操作很简单,就新建一个demo,然后在执行pod init的时候,出现了以下报错,

### Error

---
RuntimeError - [Xcodeproj] Unknown object version.
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.19.0/lib/xcodeproj/project.rb:227:in `initialize_from_file'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.19.0/lib/xcodeproj/project.rb:112:in `open'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/init.rb:41:in `validate!'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:333:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
---
[!] 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...
 - RuntimeError - [Xcodeproj] Unknown object version
   https://github.com/CocoaPods/CocoaPods/issues/11069 [closed] [3 comments]
   2 weeks ago

 - RuntimeError - [Xcodeproj] Unknown object version.
   https://github.com/CocoaPods/CocoaPods/issues/10984 [closed] [14 comments]
   2 weeks ago

 - Unknown object version
   https://github.com/CocoaPods/CocoaPods/issues/10973 [closed] [10 comments]
   28 Sep 2021
-

气不打一处来,版本重复,解决方案也很粗暴

sudo gem uninstall cocoapods

输入密码后

Successfully uninstalled cocoapods-1.9.3
Successfully uninstalled cocoapods-1.10.0
Remove executables:
    pod, sandbox-pod

in addition to the gem? [Yn]  y
Removing pod
Removing sandbox-pod
Successfully uninstalled cocoapods-1.10.1

再次安装

sudo gem install cocoapods

整完再pod init,完美。

如果有这种提醒的

Ignoring eventmachine-1.2.7 because its extensions are not built. Try: gem pristine eventmachine --version 1.2.7

直接

sudo gem pristine eventmachine --version 1.2.7

后记

要去解决问题,木得后记。

上一篇 下一篇

猜你喜欢

热点阅读