Xcode 16 pod init失败的解决方案

目录

前言

一、错误重现

二、解决方案

1.右击项目修改文件展示方式

2.修改.xcodeproj文件

3.参考文档


前言

我们使用Xcode创建新项目之后,执行pod init报错。我们看一下如何解决。

一、错误重现

RuntimeError - `PBXGroup` attempted to initialize an object with unknown ISA `PBXFileSystemSynchronizedRootGroup` from attributes: `{"isa"=>"PBXFileSystemSynchronizedRootGroup", "exceptions"=>["2AB3B2832C995E4700273321"], "explicitFileTypes"=>{}, "explicitFolders"=>[], "path"=>"DemoSample", "sourceTree"=>"<group>"}`
If this ISA was generated by Xcode please file an issue: https://github.com/CocoaPods/Xcodeproj/issues/new
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:359:in `rescue in object_with_uuid'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:349:in `object_with_uuid'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:300:in `block (2 levels) in configure_with_plist'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:299:in `each'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:299:in `block in configure_with_plist'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:296:in `each'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:296:in `configure_with_plist'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project.rb:272:in `new_from_plist'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:350:in `object_with_uuid'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:290:in `block in configure_with_plist'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:287:in `each'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project/object.rb:287:in `configure_with_plist'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project.rb:272:in `new_from_plist'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project.rb:213:in `initialize_from_file'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.23.0/lib/xcodeproj/project.rb:113:in `open'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command/init.rb:41:in `validate!'
/Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:333:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.2/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

二、解决方案

1.右击项目修改文件展示方式

图1.修改项目显示方式

2.修改.xcodeproj文件

使用文本编辑器修改**.xcodeproj**文件(VSCode或者subText等)。

移除下面的文件

minimizedProjectReferenceProxies = 1;

preferredProjectObjectVersion = 77;

然后更新项目的版本,把

objectVersion = 77

改成

to objectVersion = 56;

重新运行项目执行pod相关命令。

3.参考文档

https://github.com/CocoaPods/CocoaPods/issues/12583

相关推荐
郝晨妤17 小时前
HarmonyOS和OpenHarmony区别是什么?鸿蒙和安卓IOS的区别是什么?
android·ios·harmonyos·鸿蒙
Hgc5588866617 小时前
iOS 18.1,未公开的新功能
ios
Hamm17 小时前
先别急着喷,没好用的iOS-Ollama客户端那就自己写个然后开源吧
人工智能·llm·swift
CocoaKier18 小时前
苹果商店下载链接如何获取
ios·apple
zhlx283521 小时前
【免越狱】iOS砸壳 可下载AppStore任意版本 旧版本IPA下载
macos·ios·cocoa
XZHOUMIN1 天前
网易博客旧文----编译用于IOS的zlib版本
ios
爱吃香菇的小白菜1 天前
H5跳转App 判断App是否安装
前端·ios
二流小码农2 天前
鸿蒙开发:ForEach中为什么键值生成函数很重要
android·ios·harmonyos
hxx2212 天前
iOS swift开发--- 加载PDF文件并显示内容
ios·pdf·swift