-1

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

2 Answers2

0

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!

0

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
Ilesh P
  • 3,940
  • 1
  • 24
  • 49