1

getting this error while pod install

NoMethodError - undefined method `=~' for [["PICKER_MEDIA=1"], ["PICKER_AUDIO=1"], ["PICKER_DOCUMENT=1"]]:Array

/usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb:446:in block (2 levels) in merged_xcconfigs' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb:446:in all?' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb:446:in block in merged_xcconfigs' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb:444:in each' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb:444:in each_with_object' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb:444:in merged_xcconfigs' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb:1057:in block in <class:PodTargetSettings>' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb:120:in block in define_build_settings_method' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb:177:in block in remove_pod_target_xcconfig_overrides_from_target' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb:174:in each' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb:174:in remove_pod_target_xcconfig_overrides_from_target' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb:157:in block in add_target' internal:kernel:90:in tap' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb:156:in add_target' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb:47:in block in install!' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:149:in message' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb:40:in install!' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:115:in block in install_pod_targets' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:112:in map' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:112:in install_pod_targets' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/single_pods_project_generator.rb:32:in block in install_all_pod_targets' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:149:in message' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/single_pods_project_generator.rb:31:in install_all_pod_targets' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/single_pods_project_generator.rb:19:in generate!' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:314:in block in create_and_save_projects' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in section' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:309:in create_and_save_projects' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:301:in generate_pods_project' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:180:in integrate' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:167:in install!' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/command/update.rb:63:in run' /usr/local/lib/ruby/gems/3.2.0/gems/claide-1.1.0/lib/claide/command.rb:334:in run' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in run' /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/bin/pod:55:in <top (required)>' /usr/local/bin/pod:25:in load' /usr/local/bin/pod:25:in '

Adarsh Singh
  • 93
  • 2
  • 11
  • Try running `brew reinstall cocoapods`, then go in your project, `flutter clean` and run the app through Android Studio as you would usuallly do. – Tom Jan 11 '23 at 09:16
  • this is not the solution please check my answer for the reference – Adarsh Singh Jan 11 '23 at 17:49
  • Well your solution involves directly modifying the build settings config, it’s probably safer to reinstall cocoapods but if your solution worked then godspeed spiderman. – Tom Jan 12 '23 at 18:13
  • i tried to reinstall cocoapods but it didn't worked – Adarsh Singh Jan 14 '23 at 12:00

2 Answers2

1

Replace =~ with == in the file: /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb

line: 446 -

after modification: values_are_bools = uniq_values.all? { |v| v == /\A(yes|no)\z/i }

It will work.

Ref: https://github.com/CocoaPods/CocoaPods/issues/11720#issuecomment-1378240043

Murad Hajiyev
  • 121
  • 1
  • 10
  • This solved it for me too, my path was: vim ~/.gem/ruby/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb – 4F2E4A2E Feb 27 '23 at 14:28
0

Try this it'll solve the issue

I got the same issue in this file gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb:446:in `block (2 levels) in merged_xcconfigs' installing with gem
ruby 3.2.0
replacing "=~" by "==" seems to work but no idea if it has side effects I am just using this thing
Adarsh Singh
  • 93
  • 2
  • 11
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 12 '23 at 13:37