Xcode14（Version 14.0 beta）で作ったプロジェクトがpod initできない

# Xcode14（Version 14.0 beta）で作ったプロジェクトがpod initできない

## 環境
macOS: 13.0 Beta（22A5266r）
Xcode: Version 14.0 beta (14A5228q)
CocoaPods: 1.11.3

## 検証日
2022/06/15

## 現象
1. Xcode14でプロジェクトを作成する
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/421964/8424d5e4-5736-9d1d-1cb2-eca50d6b50a3.png)  
1. 該当プロジェクトのディレクトリで`pod init`を行うとエラーが発生する
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/421964/07f77d30-cd04-649e-3e31-af96a5362626.png)  
1. Xcode１３以前のプロジェクトは問題無く`pod init`が行える。Xode13で作成したプロジェクトをinit後にXode14で開いても影響はない。

~~~
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

```
/opt/homebrew/Cellar/cocoapods/1.11.3/libexec/bin/pod init
```

### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

```
   CocoaPods : 1.11.3
        Ruby : ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
    RubyGems : 3.3.11
        Host : macOS 13.0 (22A5266r)
       Xcode : 14.0 (14A5228q)
         Git : git version 2.32.1 (Apple Git-133)
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
```

### Error

```
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-1.11.3/lib/cocoapods/command/init.rb:41: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>'
```

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%5BXcodeproj%5D+Unknown+object+version+%2856%29.&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
 - Pod init failed on M1 Mac macOS Ventura 13.0 beta1
   https://github.com/CocoaPods/CocoaPods/issues/11406 [open] [2 comments]
   2 days ago

 - pod install has bug
   https://github.com/CocoaPods/CocoaPods/issues/10723 [closed] [24 comments]
   6 weeks ago

 - new Macbook M1 crash
   https://github.com/CocoaPods/CocoaPods/issues/10446 [closed] [39 comments]
   25 Feb 2022

and 3 more at:
https://github.com/cocoapods/cocoapods/search?q=%5BXcodeproj%5D%20Unknown%20object%20version%20%2856%29.&type=Issues&utf8=✓

~~~


## 解決方法
 
pod initを実行した時のエラー文の末尾にある https://github.com/CocoaPods/CocoaPods/issues/11406 を見ると、  
> Edit ./YourProject.xcodeproj/project.pbxproj file and change the objectVersion value to 55 will work as a workaround
とある。

私の検証ではプロジェクト名をXcode14Projectとしているので、`cd Xcode14Project.xcodeproj`で移動し、  
`open project.pbxproj`でファイルを開いた。`vi project.pbxproj`でも良いと思うけれど、お好きな方で。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/421964/454e31a1-5ff5-55d7-288c-89cdd8c918f3.png)  
6行目のobjectVersionを55に変更して保存。  
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/421964/ffe9df19-8cff-b39e-229d-7eeb83cfcd9c.png)  
その後、ターミナルで`pod init`を実行すると、問題なく成功する。
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/421964/cf260df6-195d-6bd7-99be-0f637f4868e8.png)
installまで行ったが問題はなかったので大丈夫だと思う。

## 終わりに
対処方法を見るに、CocoaPods側がちゃちゃっと修正して終わりではないかと思う。