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>'
3
Answers
After investigation, I found I need to run
Then run
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.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!