-1

After updating Xcode 14 and while running pod init I am getting the following error:

(base) shahrukh@percrymbp TestApp_uikit % pod init
Traceback (most recent call last):
    9: from /Users/shahrukh/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `<main>'
    8: from /Users/shahrukh/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `eval'
    7: from /Users/shahrukh/.rvm/gems/ruby-2.7.0/bin/pod:23:in `<main>'
    6: from /Users/shahrukh/.rvm/gems/ruby-2.7.0/bin/pod:23:in `load'
    5: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
    4: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
    3: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/claide-1.0.3/lib/claide/command.rb:333:in `run'
    2: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/lib/cocoapods/command/init.rb:41:in `validate!'
    1: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:113:in `open'
/Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:228:in `initialize_from_file': [Xcodeproj] Unknown object version (56). (RuntimeError)
    11: from /Users/shahrukh/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `<main>'
    10: from /Users/shahrukh/.rvm/gems/ruby-2.7.0/bin/ruby_executable_hooks:24:in `eval'
     9: from /Users/shahrukh/.rvm/gems/ruby-2.7.0/bin/pod:23:in `<main>'
     8: from /Users/shahrukh/.rvm/gems/ruby-2.7.0/bin/pod:23:in `load'
     7: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
     6: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
     5: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
     4: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
     3: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
     2: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:66:in `report_error'
     1: from /Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:34:in `report'
/Users/shahrukh/.rvm/rubies/ruby-2.7.0/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String: "[Xcodeproj] Unknown object version (56)." (FrozenError)
Rob
  • 415,655
  • 72
  • 787
  • 1,044
Shahrukh
  • 29
  • 3

2 Answers2

1

Just run:

gem install xcodeproj
desertnaut
  • 57,590
  • 26
  • 140
  • 166
Rgg
  • 21
  • 1
0

Change the objectVersion in the pbxproj file to 46: https://i.stack.imgur.com/gAmXp.png

desertnaut
  • 57,590
  • 26
  • 140
  • 166
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 26 '22 at 03:45