Xcode16上执行pod install报错:RuntimeError - `xxx` attempted to initialize an obc...

131 阅读2分钟

问题描述

我新建了一个demo测试工程上,我只是执行简单的pod install,安装GcdSocket的pod库,terminal报错


RuntimeError - `PBXGroup` attempted to initialize an object with unknown ISA `PBXFileSystemSynchronizedRootGroup` from attributes: `{"isa" => "PBXFileSystemSynchronizedRootGroup", "exceptions" => ["B6DA7F782DD4A25000D9234F"], "path" => "Demo", "sourceTree" => "<group>"}`

If this ISA was generated by Xcode please file an issue: https://github.com/CocoaPods/Xcodeproj/issues/new

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project/object.rb:359:in 'Xcodeproj::Project::Object::AbstractObject#object_with_uuid'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project/object.rb:300:in 'block (2 levels) in Xcodeproj::Project::Object::AbstractObject#configure_with_plist'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project/object.rb:299:in 'Array#each'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project/object.rb:299:in 'block in Xcodeproj::Project::Object::AbstractObject#configure_with_plist'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project/object.rb:296:in 'Array#each'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project/object.rb:296:in 'Xcodeproj::Project::Object::AbstractObject#configure_with_plist'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project.rb:272:in 'Xcodeproj::Project#new_from_plist'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project/object.rb:350:in 'Xcodeproj::Project::Object::AbstractObject#object_with_uuid'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project/object.rb:290:in 'block in Xcodeproj::Project::Object::AbstractObject#configure_with_plist'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project/object.rb:287:in 'Array#each'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project/object.rb:287:in 'Xcodeproj::Project::Object::AbstractObject#configure_with_plist'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project.rb:272:in 'Xcodeproj::Project#new_from_plist'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project.rb:213:in 'Xcodeproj::Project#initialize_from_file'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/xcodeproj-1.24.0/lib/xcodeproj/project.rb:113:in 'Xcodeproj::Project.open'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1194:in 'block (2 levels) in Pod::Installer::Analyzer#inspect_targets_to_integrate'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1193:in 'Hash#each'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1193:in 'block in Pod::Installer::Analyzer#inspect_targets_to_integrate'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in 'Pod::UserInterface.section'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1188:in 'Pod::Installer::Analyzer#inspect_targets_to_integrate'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:107:in 'Pod::Installer::Analyzer#analyze'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:422:in 'Pod::Installer#analyze'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:244:in 'block in Pod::Installer#resolve_dependencies'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in 'Pod::UserInterface.section'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:243:in 'Pod::Installer#resolve_dependencies'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:162:in 'Pod::Installer#install!'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/command/install.rb:52:in 'Pod::Command::Install#run'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/claide-1.1.0/lib/claide/command.rb:334:in 'CLAide::Command.run'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in 'Pod::Command.run'

/opt/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.12.1/bin/pod:55:in '<top (required)>'

/usr/local/bin/pod:23:in 'Kernel#load'

/usr/local/bin/pod:23:in '<main>'


――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

 

Search for existing GitHub issues similar to yours:

https://github.com/CocoaPods/CocoaPods/search?q=%60PBXGroup%60+attempted+to+initialize+an+object+with+unknown+ISA+%60PBXFileSystemSynchronizedRootGroup%60+from+attributes%3A+%60%7B%22isa%22+%3D%3E+%22PBXFileSystemSynchronizedRootGroup%22%2C+%22exceptions%22+%3D%3E+%5B%22B6DA7F782DD4A25000D9234F%22%5D%2C+%22path%22+%3D%3E+%22Demo%22%2C+%22sourceTree%22+%3D%3E+%22%3Cgroup%3E%22%7D%60%0AIf+this+ISA+was+generated+by+Xcode+please+file+an+issue%3A+https%3A%2F%2Fgithub.com%2FCocoaPods%2FXcodeproj%2Fissues%2Fnew&type=Issues
  

🐞解决方案

步骤 1:在 Xcode 中右键单击项目文件夹并转换为组

image.png

步骤 2:右键单击projectname.xcodeproj文件并选择显示包内容,
您可以看到文件project.pbxproj并使用文本编辑器打开

删除此文件中的以下行
minimaledProjectReferenceProxies = 1;
preferredProjectObjectVersion = 77;

还将以下版本
objectVersion = 77; 更新为 objectVersion = 56;

现在你可以使用你的项目进行 pod initinstall

之后需要把version改回去 objectVersion = 77,不然workspece打开之后不能编辑之前的project.pbxproj

引用解决方法

github.com/CocoaPods/C… blog.csdn.net/weixin_3914…