iosinit

Pod Init Error: "force_encoding': can't modify frozen String (FrozenError)" - at iOS


I encounter this error when I issue a "pod init" command for a project. Terminal is set to "Open Using Rosetta".

Images:

Open using Rosetta

pod init error

Thanks for helps.

(base) airpc@192 InstaClone % pod init

/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.1.0/lib/claide/command.rb:396:in `handle_exception'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:337:in `rescue in run'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/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/xcodeproj-1.21.0/lib/xcodeproj/project.rb:228:in `initialize_from_file': [Xcodeproj] Unknown object version (56). (RuntimeError)
    from /Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.21.0/lib/xcodeproj/project.rb:113:in `open'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/init.rb:41:in `validate!'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:333: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>'

Solution

  • I found that there may be a problem with the newly created project in Xcode14。

    You can temporarily solve this problem by following the steps in the picture.

    enter image description here