Failed iOS Build , "Error running pod install" . pod install / pod install --repo-update doesn't solve the issue

6.4k Views Asked by At

After flutter build ios --release, it got stuck in pod install, resulting in Error running pod install:

    Running pod install...                                             954ms
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      - Flutter
      - app_settings
      - biometric_storage
      - blinkid_flutter
      - camera
      - contacts_service
      - device_info_plus
      - firebase_core
      - firebase_messaging
      - flutter_biometrics
      - flutter_inappwebview
      - flutter_local_notifications
      - flutter_native_timezone
      - flutter_secure_storage
      - flutter_zendesk_chat
      - geocoding
      - geolocator_apple
      - google_ml_kit
      - image_gallery_saver
      - in_app_review
      - multi_image_picker2
      - package_info_plus
      - path_provider_ios
      - phone_number
      - printing
      - scan
      - share
      - sqflite
      - uni_links
      - url_launcher_ios
      - video_player
      - wakelock
      - webview_flutter_wkwebview

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`

Error output from CocoaPods:
↳
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String
    (FrozenError)
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `report'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:66:in `report_error'
        from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
        from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
        from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
        from /usr/local/bin/pod:23:in `load'
        from /usr/local/bin/pod:23:in `<main>'
    /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:245:in `rescue in load_yml': can not load translations from
    /Library/Ruby/Gems/2.6.0/gems/activesupport-6.1.3.2/lib/active_support/locale/en.yml: #<Psych::DisallowedClass: Tried to load unspecified class:
    Symbol> (I18n::InvalidLocaleData)
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:241:in `load_yml'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:226:in `load_file'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:18:in `block in load_translations'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:18:in `each'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:18:in `load_translations'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/simple.rb:80:in `init_translations'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/simple.rb:90:in `lookup'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:32:in `translate'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n.rb:207:in `block in translate'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n.rb:203:in `catch'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n.rb:203:in `translate'
        from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.1.3.2/lib/active_support/core_ext/array/conversions.rb:70:in `to_sentence'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/validator.rb:197:in `failure_reason'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/abstract_external_source.rb:194:in `validate_podspec'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/abstract_external_source.rb:178:in `store_podspec'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/path_source.rb:17:in `block in fetch'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:993:in `fetch_external_source'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:972:in `block (2 levels) in fetch_external_sources'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `each'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `block in fetch_external_sources'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:970:in `fetch_external_sources'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
        from /usr/local/bin/pod:23:in `load'
        from /usr/local/bin/pod:23:in `<main>'
    /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/class_loader.rb:99:in `find': Tried to load unspecified class: Symbol
    (Psych::DisallowedClass)
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/class_loader.rb:28:in `load'
        from (eval):2:in `symbol'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/class_loader.rb:32:in `symbolize'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/class_loader.rb:84:in `symbolize'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:120:in `deserialize'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:128:in `visit_Psych_Nodes_Scalar'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `each'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `each_slice'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `revive_hash'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `each'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `each_slice'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `revive_hash'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `each'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `each_slice'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `revive_hash'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `each'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `each_slice'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:343:in `revive_hash'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:318:in `visit_Psych_Nodes_Document'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:30:in `visit'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/visitor.rb:6:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych/visitors/to_ruby.rb:35:in `accept'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych.rb:334:in `safe_load'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych.rb:587:in `block in safe_load_file'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych.rb:586:in `open'
        from /Users/gustavogikis/.gem/ruby/2.6.0/gems/psych-4.0.0/lib/psych.rb:586:in `safe_load_file'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:243:in `load_yml'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:226:in `load_file'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:18:in `block in load_translations'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:18:in `each'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:18:in `load_translations'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/simple.rb:80:in `init_translations'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/simple.rb:90:in `lookup'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n/backend/base.rb:32:in `translate'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n.rb:207:in `block in translate'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n.rb:203:in `catch'
        from /Library/Ruby/Gems/2.6.0/gems/i18n-1.8.10/lib/i18n.rb:203:in `translate'
        from /Library/Ruby/Gems/2.6.0/gems/activesupport-6.1.3.2/lib/active_support/core_ext/array/conversions.rb:70:in `to_sentence'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/validator.rb:197:in `failure_reason'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/abstract_external_source.rb:194:in `validate_podspec'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/abstract_external_source.rb:178:in `store_podspec'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/path_source.rb:17:in `block in fetch'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:993:in `fetch_external_source'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:972:in `block (2 levels) in fetch_external_sources'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `each'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `block in fetch_external_sources'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:970:in `fetch_external_sources'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
        from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
        from /usr/local/bin/pod:23:in `load'
        from /usr/local/bin/pod:23:in `<main>'

After this, I go to the iOS subfolder, hoping that pod install or pod install --repo-update helps me solve the issue, but with either of those instances, I continue to get all those lines of error after the line:

 /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String
(FrozenError)

All these errors started after I had to upgrade to Monterrey, in order to have SDK 13.0 and above with XCode.

Stack

   CocoaPods : 1.11.3
        Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]
    RubyGems : 3.0.3.1
        Host : macOS 12.3.1 (21E258)
       Xcode : 13.2.1 (13C100)
         Git : git version 2.15.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories :

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-keys        : 2.2.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0

Also tried flutter --doctor, but everything there is in order.

Just a small note, before this upgrade I did make several builds that were even uploaded to Apple Store without issue.

6

There are 6 best solutions below

1
On

Although Nico's answer worked for me, I had to add this at the end of it due to permission issues '-n /usr/local/bin'

0
On

You need to update xcodeproj tool using gem command.

gem update xcodeproj

if you don't have Ruby installed, you can use this command to install it.

brew install ruby
0
On

You can temporarily change Project Format to Xcode 13.0-compatible:

enter image description here

1
On

It worked for me, execute this code in terminal.

sudo gem update xcodeproj
0
On

Update CocoaPods and clear cache: Outdated versions of CocoaPods may have bugs and compatibility issues. Run the following command to update CocoaPods to the latest version and clear cache:

sudo gem update cocoapods
pod cache clean --all
0
On

I also had the same error as you when I upgraded to the new version, this is an error caused by your ios folder

I fixed it by:

remove ios folder in project

  • cd ios
  • rm -rf ios

copy older ios folder or generate new ios folder

  • generate: flutter create -i swift

and now, you can run pod install in your ios folder

  • pod setup
  • pod install

Good luck!