我在尝试为我的 Flutter 项目运行 pod install 时遇到错误。该错误消息表明 PBXGroup 初始化存在与未知 ISA PBXFileSystemSynchronizedRootGroup 相关的问题。详情如下:
我做了什么? 我尝试在 Flutter 项目的 ios 目录中运行 pod install。
我期望会发生什么? 我希望 CocoaPods 安装必要的依赖项而不会出现任何错误。 相反发生了什么?
我收到以下错误: 运行时错误 -
PBXGroup
尝试使用来自属性的未知 ISA PBXFileSystemSynchronizedRootGroup
初始化对象:
{"isa"=>"PBXFileSystemSynchronizedRootGroup",
"exceptions"=>["E97F44AD2CB644CA004719F6"],
"explicitFileTypes"=>{}, "explicitFolders"=>[],
"path"=>"charge_liveactivity",
"sourceTree"=>"<group>"}
堆栈跟踪:
/opt/homebrew/Cellar/cocoapods/1.15.2_1/libexec/gems/xcodeproj-1.25.0/lib/xcodeproj/project/object.rb:359:in rescue in object_with_uuid'
/opt/homebrew/Cellar/cocoapods/1.15.2_1/libexec/gems/xcodeproj-1.25.0/lib/xcodeproj/project/object.rb:349:in object_with_uuid'
...
环境: 可可豆:1.15.2 红宝石:红宝石3.3.5 代码:16.0 macOS:15.0.1
Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '14.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
...
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
...
end
附加信息: 我已尝试更新 CocoaPods 并运行 pod repo update,但问题仍然存在。我还检查了 Xcode 中的项目设置,但没有发现任何错误配置。
看起来很奇怪,尝试更新cocoapods(最好的方法是通过brew)
brew upgrade cocoapods
然后删除DerivedData