Search code examples
xcodecocoapods

pod deintegrate throws RuntimeError - [Xcodeproj] Unknown object version (56)


There is an error when running pod deintegrate under /ios for React Native 0.68.2 project:

RuntimeError - [Xcodeproj] Unknown object version (56).
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:228:in `initialize_from_file'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:113:in `open'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-deintegrate-1.0.5/lib/cocoapods/command/deintegrate.rb:40:in `validate!'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:333:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `load'
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod:25:in `<main>' 

Here is the output of pod env:

### Stack

```
   CocoaPods : 1.11.3
        Ruby : ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
    RubyGems : 3.3.11
        Host : macOS 12.5 (21G72)
       Xcode : 14.0 (14A5270f)
         Git : git version 2.32.3 (Apple Git-135)
Ruby lib dir : /opt/homebrew/Cellar/ruby/3.1.2/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
```

### Plugins

```
cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0
```

Here is the output of ruby -version and which ruby:

ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
-e:1:in `<main>': undefined local variable or method `rsion' for main:Object (NameError)

/usr/bin/ruby

There were many similar issues posted online. gem update xcodeproj didn't help as there was no update.


Solution

  • Edit YourProject.xcodeproj/project.pbxproj file and change the objectVersion value to 55 will work as a workaround

    // !$*UTF8*$!
    {
        archiveVersion = 1;
        classes = {
    };
    objectVersion = 55;
    objects = {