LoginSignup
7
6

More than 1 year has passed since last update.

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

Posted at

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
  2. 該当プロジェクトのディレクトリでpod initを行うとエラーが発生する
    image.png
  3. Xcode13以前のプロジェクトは問題無く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
6行目のobjectVersionを55に変更して保存。
image.png
その後、ターミナルでpod initを実行すると、問題なく成功する。
image.png
installまで行ったが問題はなかったので大丈夫だと思う。

終わりに

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

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6