美文网首页
Xcode13 RuntimeError - [Xcodepro

Xcode13 RuntimeError - [Xcodepro

作者: 悟饭哪 | 来源:发表于2021-10-15 15:19 被阅读0次

问题

使用 Xcode13创建项目后,执行pod init命令时,遇到报错如下:

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

/usr/local/bin/pod init

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

   CocoaPods : 1.10.0
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
    RubyGems : 3.0.3
        Host : macOS 11.4 (20F71)
       Xcode : 12.5.1 (12E507)
         Git : git version 2.30.1 (Apple Git-130)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : aliyun - git - https://github.com/aliyun/aliyun-specs.git @ b19a22716742648dc8e2173e2e22b1b49754036b

               cocoapods - git - https://github.com/CocoaPods/Specs.git @ 89ae3a4bba49a335e3d67297d9b292f358ce0681

               trunk - CDN - https://cdn.cocoapods.org/

### Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0

### 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.0/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.0/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] 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/10984 [closed] [11 comments]
   a week ago

 - Unknown object version
   https://github.com/CocoaPods/CocoaPods/issues/10973 [closed] [10 comments]
   2 weeks ago

 - RuntimeError - [Xcodeproj] Unknown object version.
   https://github.com/CocoaPods/CocoaPods/issues/7458 [closed] [21 comments]
   a week ago

and 70 more at:
https://github.com/cocoapods/cocoapods/search?q=%5BXcodeproj%5D%20Unknown%20object%20version.&type=Issues&utf8=✓

解决方法:

执行命令sudo gem update xcodeproj --pre,如下:

david@davidjias-MacBook-Pro rxswiftdemo % sudo gem update xcodeproj --pre
Updating installed gems
Updating xcodeproj
Fetching rexml-3.2.5.gem
Fetching xcodeproj-1.21.0.gem
Successfully installed rexml-3.2.5
Successfully installed xcodeproj-1.21.0
Parsing documentation for rexml-3.2.5
Installing ri documentation for rexml-3.2.5
Installing darkfish documentation for rexml-3.2.5
Parsing documentation for xcodeproj-1.21.0
Installing ri documentation for xcodeproj-1.21.0
Installing darkfish documentation for xcodeproj-1.21.0
Done installing documentation for rexml, xcodeproj after 4 seconds
Parsing documentation for rexml-3.2.5
Parsing documentation for xcodeproj-1.21.0
Done installing documentation for rexml, xcodeproj after 1 seconds
Gems updated: rexml xcodeproj

再次执行pod init不会再报错了。

Have fun.

相关文章

网友评论

      本文标题:Xcode13 RuntimeError - [Xcodepro

      本文链接:https://www.haomeiwen.com/subject/xtemoltx.html