pod init cause RuntimeError - [Xcodeproj] Unknown object version

Viewed 2191

When I run pod init, I got the following 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>'
2 Answers

After investigation, I found I need to run

sudo gem update xcodeproj 

Then run

pod init

I've got very similar error: RuntimeError - [Xcodeproj] Unknown object version (56).

It turns out the cocopapods doesn't know how to work with Xcode 14 project version properly and it complains instead.

To solve the issue, open Xcode project on the right side utility panel and change the project version to Xcode 13.0 - compatible and you are good to go.

Changing Xcode version to Xcode 13.0 to fix cocoapods issue about object version 56

Related