An error occurred while processing the post-install hook of the Podfile. Not able to run flutter project on iOS simulator getting pod error
Asked Answered
H

4

7

I have setup a firebase project for my flutter project but while running the project I'm getting the below error. I have tried to install the pod properly but still, there is an error while executing. Please if you have any idea let me know. I have shared the console log

- Generating dummy source at `Pods/Target Support Files/Pods-Runner/Pods-Runner-dummy.m`
      - Generating deterministic UUIDs
      - Stabilizing target UUIDs
      - Running post install hooks
    [!] An error occurred while processing the post-install hook of the Podfile.

    undefined method `each_child' for #<Dir:0x00007fd6d1da4a58>

    Documents/Flutter/packages/flutter_tools/bin/podhelper.rb:57:in `block in flutter_additional_ios_build_settings'
    Documents/Flutter/packages/flutter_tools/bin/podhelper.rb:54:in `each'
    Documents/Flutter/packages/flutter_tools/bin/podhelper.rb:54:in `flutter_additional_ios_build_settings'
    flutter-project/ios/Podfile:41:in `block (3 levels) in from_ruby'
    flutter-projecty/ios/Podfile:40:in `each'
    flutter-project/ios/Podfile:40:in `block (2 levels) in from_ruby'
    /Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.10.2/lib/cocoapods-core/podfile.rb:179:in
    `post_install!'
    /Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:897:in
    `run_podfile_post_install_hook'
    /Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:885:in `block in
    run_podfile_post_install_hooks'
    /Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/user_interface.rb:145:in `message'
    /Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:884:in
    `run_podfile_post_install_hooks'
    /Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:329:in `block (2 levels) in
    create_and_save_projects'
    /Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/installer/xcode/pods_project_generator/pod
    s_project_writer.rb:61:in `write!'
    /Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:328:in `block in
    create_and_save_projects'
    /Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:307:in
    `create_and_save_projects'
/Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:178:in `integrate'
/Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/installer.rb:166:in `install!'
/Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/command/install.rb:52:in `run'
/Users/.rvm/gems/ruby-2.5.5/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/lib/cocoapods/command.rb:52:in `run'
/Users/.rvm/rubies/ruby-2.5.5/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.2/bin/pod:55:in `<top (required)>'
/Users/.rvm/gems/ruby-2.5.5/bin/pod:23:in `load'
/Users/.rvm/gems/ruby-2.5.5/bin/pod:23:in `<main>'

Error running pod install
Error launching application on iPhone 8.
Havana answered 3/10, 2021 at 7:52 Comment(0)
H
7

I have resolved this issue, the issue with the podfile hence I have run the following command and it works.

sudo gem install cocoapods

for more information I have raised this on GitHub you can find here

Havana answered 11/10, 2021 at 5:41 Comment(0)
S
9

navigate to ios directory then Run these commands

cd ios (navigate to ios directory)
flutter precache --ios
pod install 
Steradian answered 20/6, 2022 at 4:41 Comment(3)
One tiny nuance here. If you are using flutter version manager, do not forget to run all flutter commands starting with fvm. Otherwise it will not solve the issue. That is: fvm flutter precache --iosCherianne
Elmars' comment was the missing nuance for me :)Maracaibo
I am using react native, how to fix it thereGandhiism
H
7

I have resolved this issue, the issue with the podfile hence I have run the following command and it works.

sudo gem install cocoapods

for more information I have raised this on GitHub you can find here

Havana answered 11/10, 2021 at 5:41 Comment(0)
M
1

in your pod file,

# platform :ios, '9.0'

uncomment this line and change 9.0 to 10.0 and run the app. it will take some time at the first. like 20 - 30 minutes.

Masto answered 3/10, 2021 at 15:54 Comment(1)
I have already done that still getting the same error.Havana
I
0

In flutter, i manually delete ios/build, ios/Pods, and ios/Podfile.lock. And i managed to run pod install successfully instead of run pod update.

Ioneionesco answered 2/8, 2024 at 10:12 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.