Xcode 14 新建项目无法pod 报错

参考链接:

http://www.licqi.com/artikel/11110.html

问题:Xcode 14 创建的新项目,无法进行Pod install

报错如下:

[!] 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 in xcode 14.1 and mac os ventura 13.0.1
   https://github.com/CocoaPods/CocoaPods/issues/11656 [open] [19 comments]
   a week ago

 - pod init after update it to XCODE 14
   https://github.com/CocoaPods/CocoaPods/issues/11546 [open] [21 comments]
   2 weeks ago

 - 'pod init' and 'pod install' both fail with "can't modify frozen String (FrozenError)"
   https://github.com/CocoaPods/CocoaPods/issues/11594 [closed] [4 comments]
   3 days ago
end
```

### Error

```
RuntimeError - [Xcodeproj] Unknown object version (56).
/Users/zst01/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:228:in `initialize_from_file'
/Users/zst01/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:113:in `open'
........

提示: Unknown object version (56) --未知对象版本(56)

解决:如何修改compatibilityVersion呢?可以通过 Project Format,可以暂时将Project Format:

 Xcode 14.0-compatible改为Xcode 13.0-compatible

如图:

 原因:

是版本不匹配导致的,应该和升级Xcode 14有关系。

in `initialize_from_file': [Xcodeproj] Unknown object version (56). (RuntimeError)

但是官方还没有给出解决方案。应该后续会有兼容的cocoapods 新版本。
通过与老项目对比发现是compatibilityVersion Xcode 兼容版本不一致,那么我们就可以将这个版本修改到低版本试试

猜你喜欢

转载自blog.csdn.net/ws1836300/article/details/129746101