Flutter pod:处理Podfile的安装后挂钩时出错

yftpprvb  于 2023-04-22  发布在  Flutter
关注(0)|答案(2)|浏览(123)

问题是,当我在安装了一个插件(在这种情况下是firebase_core)后运行flutter应用程序时,我会得到一个错误:
处理Podfile的安装后挂钩时出错。

〈Pod的未定义局部变量或方法“continue”::Podfile:0x00000001099e67b8@defined_in_file =#路径名:/Volumes/Coding-IT/Coding/Projects/flutter_37hours/ios/Podfile,@internal_hash ={},@root_target_definitions =[#〈Pod::Podfile::TargetDefinition label = Pod〉],@current_target_definition =#〈Pod::Podfile::TargetDefinition label = Pod〉,@post_install_callback =#〈Proc:0x0000000109a07e40/Volumes/Coding-IT/Coding/Projects/flutter_37hours/ios/Podfile:37〉,@installation_options =#〈Pod::安装程序::安装选项:0x000000109ab6eb8@clean = true,@deduplicate_targets = true,@deterministic_uuids = true,@integrate_targets = true,@lock_pod_sources = true,@warn_for_multiple_pod_sources = true,@warn_for_unused_master_specs_repo = true,@share_schemes_for_development_pods = false,@disable_input_output_paths = false,@preserve_pod_file_structure = false,@generate_multiple_pod_projects = false,@incremental_installation = false,@skip_pods_project_generation = false〉〉

continue if xcframework_file.start_with?(".") # Hidden file, possibly on external disk.

这个问题似乎与continue单词有关,但我不知道为什么会发生这种情况以及如何解决这个问题:(我已经尝试过多次重新安装cocoapods,从homebrew和rubygems,我尝试过flutter clean,我尝试过重新安装ruby和更改版本。没有运气。希望有人能帮助我,谢谢

r3i60tvu

r3i60tvu1#

我也在查这个,好像跟这个问题有关:https://github.com/flutter/flutter/issues/104118
但它的关闭修复似乎是合并与Flutter主分支。Idk!可能需要等待下一个Flutter更新。
编辑-我刚刚在beta频道试用了这个,pod安装完成。所以你可以等到它稳定或切换频道运行iOS。干杯!

b91juud3

b91juud32#

如果有人面临同样的问题,
1.检查ruby安装(使用ruby 3.1.3p185以上版本)
1.检查coco-pads(上述10.1.2)
1.删除并重新下载整个Flutter SDK
移动到iOS文件夹,运行flutter pre cache,然后安装pod
对于ruby〉〉brew,安装rbenv 3.1.3(或者使用任何你想要的版本)
which ruby〉〉〉(在mac /usr/local/var/rbenv/shims/ruby上确认安装路径)
sudo gem install bundler〉〉〉(cocopoads需要)
对于cocopoads〉〉sudo gem uninstall cocopods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-decompose
sudo gem uninstall cocoapods-downloader
sudo gem uninstall cocoapods-plugins
sudo gem uninstall cocoapods-search
sudo gem uninstall cocoapods-trunk
sudo gem uninstall cocoapods-try
sudo gem install cocoapods -v 1.10.3
sudo gem install cocoapods -v 1.11.3
删除Flutter SDK,并重新下载到之前存在的相同路径。
然后在你的项目上,移动到你的ios文件夹并运行
Flutter预缓存-ios
cd../(向后移动)
扑式酒吧
光盘 ios
pod install --verbose

相关问题