Skip to content

Error running pod install, undefined local variable or method 'continue' for #<Pod::Podfile:0x00000001095c1188 @defined_in_file=#<Pathname:/path/to/ios/Podfile> #104118

Closed
@byytelope

Description

@byytelope

Steps to Reproduce

  1. Initialize new flutter app.
  2. Add any pub dependency.
  3. Run on iOS simulator.

I have tried reinstalling and upgrading both ruby and cocoapods but nothing seems to work. Not sure if this is a flutter problem but figured I will report here because I am not familiar with ruby at all.

Logs

Logs
Launching lib/main.dart on iPhone 13 in debug mode...
CocoaPods' output:
↳
      Preparing
    Analyzing dependencies
    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `path_provider_ios` from `.symlinks/plugins/path_provider_ios/iOS`
    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
    Comparing resolved specification to the sandbox manifest
      A Flutter
      A path_provider_ios
    Downloading dependencies
    -> Installing Flutter (1.0.0)
    -> Installing path_provider_ios (0.0.1)
      - Running pre install hooks
      - Running pre integrate hooks
    Generating Pods project
      - Creating Pods project
      - Installing files into Pods project
        - Adding source files
        - Adding frameworks
        - Adding libraries
        - Adding resources
        - Adding development pod helper files
        - Linking headers
      - Installing Pod Targets
        - Installing target `Flutter` iOS 9.0
        - Installing target `path_provider_ios` iOS 9.0
          - Generating module map file at `Pods/Target Support Files/path_provider_ios/path_provider_ios.modulemap`
          - Generating umbrella header at `Pods/Target Support Files/path_provider_ios/path_provider_ios-umbrella.h`
          - Generating Info.plist file at `Pods/Target Support Files/path_provider_ios/path_provider_ios-Info.plist`
          - Generating dummy source at `Pods/Target Support Files/path_provider_ios/path_provider_ios-dummy.m`
      - Installing Aggregate Targets
        - Installing target `Pods-Runner` iOS 12.0
          - Generating Info.plist file at `Pods/Target Support Files/Pods-Runner/Pods-Runner-Info.plist`
          - Generating module map file at `Pods/Target Support Files/Pods-Runner/Pods-Runner.modulemap`
          - Generating umbrella header at `Pods/Target Support Files/Pods-Runner/Pods-Runner-umbrella.h`
          - 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 local variable or method `continue' for #<Pod::Podfile:0x00000001095c1188 @defined_in_file=#<Pathname:/Users/mohamedshadhan/Dev/Flutter/test_app/ios/Podfile>, @internal_hash={}, @root_target_definitions=[#<Pod::Podfile::TargetDefinition label=Pods>], @current_target_definition=#<Pod::Podfile::TargetDefinition label=Pods>, @post_install_callback=#<Proc:0x00000001095e22c0 /Users/mohamedshadhan/Dev/Flutter/test_app/ios/Podfile:37>, @installation_options=#<Pod::Installer::InstallationOptions:0x0000000109690dc0 @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.
          ^^^^^^^^
    /Users/mohamedshadhan/Tools/flutter/packages/flutter_tools/bin/podhelper.rb:63:in `block (2 levels) in flutter_additional_ios_build_settings'
    /Users/mohamedshadhan/Tools/flutter/packages/flutter_tools/bin/podhelper.rb:62:in `each_child'
    /Users/mohamedshadhan/Tools/flutter/packages/flutter_tools/bin/podhelper.rb:62:in `block in flutter_additional_ios_build_settings'
    /Users/mohamedshadhan/Tools/flutter/packages/flutter_tools/bin/podhelper.rb:51:in `each'
    /Users/mohamedshadhan/Tools/flutter/packages/flutter_tools/bin/podhelper.rb:51:in `flutter_additional_ios_build_settings'
    /Users/mohamedshadhan/Dev/Flutter/test_app/ios/Podfile:39:in `block (3 levels) in from_ruby'
    /Users/mohamedshadhan/Dev/Flutter/test_app/ios/Podfile:38:in `each'
    /Users/mohamedshadhan/Dev/Flutter/test_app/ios/Podfile:38:in `block (2 levels) in from_ruby'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/podfile.rb:196:in `post_install!'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:945:in `run_podfile_post_install_hook'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:933:in `block in run_podfile_post_install_hooks'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:149:in `message'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:932:in `run_podfile_post_install_hooks'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:331:in `block (2 levels) in create_and_save_projects'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:330:in `block in create_and_save_projects'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:309:in `create_and_save_projects'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:301:in `generate_pods_project'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:180:in `integrate'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:167:in `install!'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/bin/pod:25:in `load'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/bin/pod:25:in `<main>'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:947:in `rescue in run_podfile_post_install_hook'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:944:in `run_podfile_post_install_hook'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:933:in `block in run_podfile_post_install_hooks'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:149:in `message'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:932:in `run_podfile_post_install_hooks'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:331:in `block (2 levels) in create_and_save_projects'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:330:in `block in create_and_save_projects'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:309:in `create_and_save_projects'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:301:in `generate_pods_project'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:180:in `integrate'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:167:in `install!'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/bin/pod:25:in `load'
    /Users/mohamedshadhan/.rbenv/versions/3.1.2/bin/pod:25:in `<main>'
Error running pod install
Error launching application on iPhone 13.
Exited
[✓] Flutter (Channel stable, 3.0.0, on macOS 12.3.1 21E258 darwin-arm, locale en-US)
    • Flutter version 3.0.0 at /Users/mohamedshadhan/Tools/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee4e09cce0 (9 days ago), 2022-05-09 16:45:18 -0700
    • Engine revision d1b9a6938a
    • Dart version 2.17.0
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mohamedshadhan/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.67.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (3 available)
    • iPhone 13 (mobile) • BF7F1A43-DB60-455F-B272-B23DF8ADD4A8 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64   • macOS 12.3.1 21E258 darwin-arm
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 101.0.4951.64

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Activity

fabianogadenz

fabianogadenz commented on May 19, 2022

@fabianogadenz

I have one script when help me in the ios errors... try:

   flutter clean 2>&1 >/dev/null
   pod repo update
   cd ios
   rm -rf Podfile.lock Pods/ 2>&1 >/dev/null
   cd ..
   rm -rf pubspec.lock .packages .flutter-plugins 2>&1 >/dev/null
   flutter pub pub cache repair
   flutter packages get
   cd ios
   pod install --verbose
   cd ..
darshankawar

darshankawar commented on May 19, 2022

@darshankawar
Member

Per the error log:

undefined local variable or method 'continue' for #<Pod::Podfile:0x00000001095c1188 @defined_in_file=#<Pathname:/Users/mohamedshadhan/Dev/Flutter/test_app/ios/Podfile>

It indicates there's undefined term continue in your podfile , /Users/mohamedshadhan/Dev/Flutter/test_app/ios/Podfile>, so you'll need to check that and remove if not necessary.

Closing as this isn't a Flutter issue.

added
r: invalidIssue is closed as not valid
and removed
in triagePresently being triaged by the triage team
on May 19, 2022
byytelope

byytelope commented on May 19, 2022

@byytelope
Author

Per the error log:

undefined local variable or method 'continue' for #<Pod::Podfile:0x00000001095c1188 @defined_in_file=#<Pathname:/Users/mohamedshadhan/Dev/Flutter/test_app/ios/Podfile>

It indicates there's undefined term continue in your podfile , /Users/mohamedshadhan/Dev/Flutter/test_app/ios/Podfile>, so you'll need to check that and remove if not necessary.

Closing as this isn't a Flutter issue.

Hello, I managed to fix this by changing line 63 of packages/flutter_tools/bin/podhelper.rb from

continue if xcframework_file.start_with?(".")

to

if xcframework_file.start_with?(".")
  next

Would this be a flutter issue? If not, what might be causing this syntax(?) error on specifically my system? I do not believe my podfile was the issue here.

gladius

gladius commented on May 19, 2022

@gladius

@byytelope I was stuck with the same issue for a whole day. I noticed this error showing up after adding firebase_core to a fresh flutter 3 project.

I am not entirely sure, but this might be because I had my flutter installation and the project on an external ssd. Moving both flutter installation and the project to mac disk seems to fix this issue.

I did this because the # Hidden file, possibly on external disk. comment in the stack trace caught my eyes. This issue with external disk might have started with the recent mac os update 12.4 or flutter 3.

jmagman

jmagman commented on May 20, 2022

@jmagman
Member

It indicates there's undefined term continue in your podfile , /Users/mohamedshadhan/Dev/Flutter/test_app/ios/Podfile>, so you'll need to check that and remove if not necessary.

Closing as this isn't a Flutter issue.

It is a Flutter issue, this is coming from our scripts. You can see it in the backtrace:

  /Users/mohamedshadhan/Tools/flutter/packages/flutter_tools/bin/podhelper.rb:63:in `block (2 levels) in flutter_additional_ios_build_settings'
    /Users/mohamedshadhan/Tools/flutter/packages/flutter_tools/bin/podhelper.rb:62:in `each_child'
    /Users/mohamedshadhan/Tools/flutter/packages/flutter_tools/bin/podhelper.rb:62:in `block in flutter_additional_ios_build_settings'
    /Users/mohamedshadhan/Tools/flutter/packages/flutter_tools/bin/podhelper.rb:51:in `each'
    /Users/mohamedshadhan/Tools/flutter/packages/flutter_tools/bin/podhelper.rb:51:in `flutter_additional_ios_build_settings'

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

should be

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

I swear I tested this, but obviously not since continue isn't a thing in Ruby... #99771

added
platform-iosiOS applications specifically
toolAffects the "flutter" command-line tool. See also t: labels.
P2Important issues not at the top of the work list
and removed
r: invalidIssue is closed as not valid
on May 20, 2022
self-assigned this
on May 20, 2022
changed the title [-]Error running pod install after upgrading to flutter 3.0.0[/-] [+]Error running pod install, undefined local variable or method 'continue' for #<Pod::Podfile:0x00000001095c1188 @defined_in_file=#<Pathname:/path/to/ios/Podfile>[/+] on May 20, 2022
added
r: fixedIssue is closed as already fixed in a newer version
on May 24, 2022
github-actions

github-actions commented on Jun 7, 2022

@github-actions

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

locked as resolved and limited conversation to collaborators on Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @jmagman@fabianogadenz@byytelope@gladius@darshankawar

    Issue actions

      Error running pod install, undefined local variable or method 'continue' for #<Pod::Podfile:0x00000001095c1188 @defined_in_file=#<Pathname:/path/to/ios/Podfile> · Issue #104118 · flutter/flutter