48

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>'
Elye
  • 53,639
  • 54
  • 212
  • 474

4 Answers4

105

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

Denis
  • 3,167
  • 1
  • 22
  • 23
83

After investigation, I found I need to run

sudo gem update xcodeproj 

Then run

pod init
Elye
  • 53,639
  • 54
  • 212
  • 474
12

I initially tried this: sudo gem update xcodeproj

If it did not work (that was my case):

brew uninstall cocoapods

then

sudo gem install cocoapods

after that

pod init

This worked for me!

one1color
  • 151
  • 1
  • 6
0

I got this error because podfile not created correctly.

I have created podfile as touch podfile instead of touch Podfile After researching log found that Podfile should start with capital.

Hope this helps!!