CocoaPods 要求您的终端使用 UTF-8 编码。考虑将以下内容添加到 ~/.profile。导出 LANG=en_US.UTF-8

2024-01-12

[!] An error occurred while processing the post-install hook of the Podfile.

undefined method `each_child' for #<Dir:0x00007ff3fa3555c0>
Did you mean?  each_slice

/Applications/FlutterSDK/flutter/packages/flutter_tools/bin/podhelper.rb:54:in `block in flutter_additional_ios_build_settings'
/Applications/FlutterSDK/flutter/packages/flutter_tools/bin/podhelper.rb:51:in `each'
/Applications/FlutterSDK/flutter/packages/flutter_tools/bin/podhelper.rb:51:in `flutter_additional_ios_build_settings'
/Users/macpro5/Downloads/oos-master/ios/Podfile:39:in `block (3 levels) in from_ruby'
/Users/macpro5/Downloads/oos-master/ios/Podfile:38:in `each'
/Users/macpro5/Downloads/oos-master/ios/Podfile:38:in `block (2 levels) in from_ruby'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:179:in `post_install!'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:897:in `run_podfile_post_install_hook'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:885:in `block in run_podfile_post_install_hooks'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:884:in `run_podfile_post_install_hooks'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:329:in `block (2 levels) in create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:328:in `block in create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:307:in `create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:178:in `integrate'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:166:in `install!'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:899:in `rescue in run_podfile_post_install_hook'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:896:in `run_podfile_post_install_hook'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:885:in `block in run_podfile_post_install_hooks'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:884:in `run_podfile_post_install_hooks'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:329:in `block (2 levels) in create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:328:in `block in create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:307:in `create_and_save_projects'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:178:in `integrate'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:166:in `install!'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

CocoaPods 的错误输出: ↳ 警告:CocoaPods 要求您的终端使用 UTF-8 编码。 考虑将以下内容添加到 ~/.profile 中:

    export LANG=en_US.UTF-8
    

运行 pod install 时出错 在 iPhone 12 Pro Max 上启动应用程序时出错。


只需将您的 cocoapods 版本更改为 1.10.2 即可解决您的问题。

首先卸载当前版本(无论是什么)

就我而言,我从版本 1.11.1 降级

sudo gem uninstall cocoapods

然后只需安装稳定版本(截至2021年11月11日)

sudo gem install cocoapods:1.10.2

并再次构建您的应用程序。

如果仍然不起作用,请从构建目录中删除以下内容:

  • Podfile
  • Podfile.lock
  • Pod(目录) 并构建。

它为我解决了这个问题,在过去几天里两次。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

CocoaPods 要求您的终端使用 UTF-8 编码。考虑将以下内容添加到 ~/.profile。导出 LANG=en_US.UTF-8 的相关文章

随机推荐