Flutter Pod:处理Podfile的后安装后钩时发生了错误

发布于 2025-02-08 16:22:31 字数 1356 浏览 1 评论 0原文

问题是,当我在安装插件后运行flutter应用程序(在这种情况下为Firebase_core)时,我会遇到一个错误:

处理处理后安装后挂钩时发生了错误 podfile。

未定义的局部变量或方法`继续 #< pod :: podfile:0x000000010999e67b8 @defined_in_file =#pathName:/polumes/coding-it/coding/projects/flutter_37hours/ios/ios/podfile, @Internal_hash = {}, @root_target_definitions = [#< pod :: podfile :: targetDefinition 标签= pods>], @current_target_definition =#< pod :: podfile :: targetDefinition label = pods>,@post_install_callback =#< proc:0x000000010109a07e40 /卷/coding-it/coding/projects/flutter_37hours/ios/podfile:37>, @installation_options =#< pod :: installer :: installationOptions:0x000000010109ab6eb8 @clean = true, @deduplicate_targets = true, @cestricinistic_uuids = true, @Integrate_targets = true, @lock_pod_sources = true, @warn_for_multipy_pod_sources = true, @warn_for_unused_master_specs_repo = true, @share_schemes_for_development_pods = false, @disable_input_output_paths = false, @prisever_pod_file_structure = false, @generate_multiple_pod_projects = false, @cormemental_installation = false, @skip_pods_project_generation = false>>

 如果xcframework_file.start_with?(“。”)#隐藏文件,可能在外部磁盘上继续。
 

问题似乎与继续词有关,但是我不知道为什么会发生这种情况以及如何解决问题:( 我尝试过多次重新安装Cocoapods,从Homebrew和Rubygems开始,我尝试了Flutter Clean,我尝试重新安装Ruby和更改版本。没有运气。希望有人可以帮助我,谢谢

The problem is that when I run a flutter app after having installed a plugin (firebase_core in this case) I get an error:

An error occurred while processing the post-install hook of the
Podfile.

undefined local variable or method `continue' for
#<Pod::Podfile:0x00000001099e67b8 @defined_in_file=#Pathname:/Volumes/Coding-IT/Coding/Projects/flutter_37hours/ios/Podfile,
@internal_hash={},
@root_target_definitions=[#<Pod::Podfile::TargetDefinition
label=Pods>],
@current_target_definition=#<Pod::Podfile::TargetDefinition
label=Pods>, @post_install_callback=#<Proc:0x0000000109a07e40
/Volumes/Coding-IT/Coding/Projects/flutter_37hours/ios/Podfile:37>,
@installation_options=#<Pod::Installer::InstallationOptions:0x0000000109ab6eb8
@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.

The problem appears to be with the continue word, but I don't know exactly why this is happening and how to solve the problem :(
I've tried reinstalling cocoapods multiple times, from homebrew and from rubygems, I tried flutter clean, I tried reinstalling ruby and changing versions. No luck. Hope someone can help me, thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一个人的旅程 2025-02-15 16:22:31

我也在调查。它似乎与这个问题有关: https://github.com/github.com/flutter/flutter/flutter/flutter/issues/issues /104118

但它已关闭,修复程序似乎与Flutter Master分支合并。 idk!可能需要等待下一个扑朔迷离更新。

编辑 - 我刚刚在Beta通道上尝试了此操作,并且已完成POD安装。因此,您可以等到它在稳定或开关通道上运行iOS。干杯!

I'm looking into this too. It seems to be related to this issue: https://github.com/flutter/flutter/issues/104118

But it's closed the fix seems to be merged with flutter master branch. Idk! Might need to wait for next flutter update.

edit - I just tried this on beta channel and pod install completed. So you can wait till it's on stable or switch channels to run iOS. Cheers!

泼猴你往哪里跑 2025-02-15 16:22:31

任何人都面临同一问题,

  1. 请检查Ruby安装(在Ruby上方使用3.1.3p185)
  2. 检查可可垫(上面的10.1.2)
  3. 删除并重新下载整个Flutter SDK

移动到iOS文件夹,然后运行Pre flutter Pre Cache,然后pod

instanci Ruby&gt;&gt; brew install rbenv 3.1.3(或使用您想要的任何版本)

which ruby >>> (To confirm installation path on mac /usr/local/var/rbenv/shims/ruby)

sudo gem install bundler >>> (needed for cocopoads)

用于Cocopoads&gt;&gt;

sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-deintegrate
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 precache --ios
cd ../ (to move back)
flutter pub get
cd ios
pod install --verbose

Incase anyone is facing this same issue,

  1. Check ruby installation (use above ruby 3.1.3p185)
  2. Check coco-pads (10.1.2 above)
  3. Delete and Redownload your entire flutter sdk

move to iOS folder, run flutter pre cache, then pod install

For ruby >> brew install rbenv 3.1.3 (or use any version you want)

which ruby >>> (To confirm installation path on mac /usr/local/var/rbenv/shims/ruby)

sudo gem install bundler >>> (needed for cocopoads)

For cocopoads>>

sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-deintegrate
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

Delete Flutter SDK, and redownload to the same path it existed before.

Then on your project, move to your ios folder and run

flutter precache --ios
cd ../ (to move back)
flutter pub get
cd ios
pod install --verbose
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文