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

相关推荐
胡八一7 小时前
Window调试 ios 的 Safari 浏览器
前端·ios·safari
karshey11 小时前
【IOS webview】源代码映射错误,页面卡住不动
ios
LinXunFeng12 小时前
Flutter - Xcode16 还原编译速度
前端·flutter·xcode
鸿蒙布道师12 小时前
鸿蒙NEXT开发土司工具类(ArkTs)
android·ios·华为·harmonyos·arkts·鸿蒙系统·huawei
Andy_shenzl15 小时前
16、Swift框架微调实战(1)-自我认知数据LORA微调
lora·微调·swift
思考着亮16 小时前
2.流程控制
ios
得物技术3 天前
得物 iOS 启动优化之 Building Closure
ios·性能优化
goto_w3 天前
uniapp上使用webview与浏览器交互,支持三端(android、iOS、harmonyos next)
android·vue.js·ios·uni-app·harmonyos
Swift社区3 天前
Swift LeetCode 246 题解:中心对称数(Strobogrammatic Number)
开发语言·leetcode·swift
鸿蒙布道师4 天前
鸿蒙NEXT开发对象工具类(TS)
android·ios·华为·harmonyos·arkts·鸿蒙系统·huawei