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

相关推荐
yngsqq2 小时前
037集——JoinEntities连接多段线polyline和圆弧arc(CAD—C#二次开发入门)
开发语言·c#·swift
麦田里的守望者江2 小时前
KMP 中的 expect 和 actual 声明
android·ios·kotlin
_黎明4 小时前
【Swift】字符串和字符
开发语言·ios·swift
ZVAyIVqt0UFji5 小时前
iOS屏幕共享技术实践
macos·ios·objective-c·cocoa
hfxns_7 小时前
iOS 18.2 Beta 4开发者预览版发布,相机新增辅助功能
ios
AirDroid_cn17 小时前
如何控制自己玩手机的时间?两台苹果手机帮助自律
ios·智能手机·ipad·手机使用技巧·苹果手机使用技巧
郝晨妤19 小时前
鸿蒙原生应用开发元服务 元服务是什么?和App的关系?(保姆级步骤)
android·ios·华为od·华为·华为云·harmonyos·鸿蒙
tealcwu20 小时前
【Unity踩坑】在Mac上安装Cocoapods失败
unity·ios·游戏引擎
名字不要太长 像我这样就好1 天前
【iOS】iOS的轻量级数据库——FMDB
数据库·ios·sqlite·objective-c
@解忧杂货铺1 天前
Android和IOS的区别
android·ios·cocoa