Getting error while run flutter app in iOS
Solution 1
It seems that is a sort of bug/incombatibility issue in Cocoapods v 1.11.0
To fix the issue, I followed these steps and it worked like a charm: https://stackoverflow.com/a/69076515/16881741
Briefly, follow these steps:
-
In your terminal, in ios folder type
gem list --local | grep cocoapods
-
Take note of what is the output of the previous command. It looks like that (please ignore the version near the various entry, this is my output and I already use the version 1.10.1):
cocoapods (1.10.1)
cocoapods-core (1.10.1)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.5.1)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
cocoapods-try (1.2.0)
- One by one, launch the command
sudo gem uninstall X
substituting the "X" with the name of the cocoapods component, without the version. At the end you should obtain this:
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-deintegrate
sudo gem uninstall cocoapods-downloader
sudo gem uninstall cocoapods-plugins
sudo gem uninstall cocoapods-search
sudo gem uninstall cocoapods-trunk
sudo gem uninstall cocoapods-try
Be sure to have included all the component listed in the point n.1 to avoid dirty status
- Use the command
sudo gem install cocoapods -v 1.10.1
To obtain the correct version.
All kudos to Esteban Lopez, the author of the answer I linked at the top.
Solution 2
This issues appeared in Cocoapods 1.11.0 and as many already noticed rolling back to 1.10.2 fixes the issue. But the original issue comes from wrong locale set in the terminal. It has to be a UTF-8-based locale.
The second answer in here solved the issue for me.
As stated, just run
export LC_ALL=en_US.UTF-8
in your terminal, and the error should go away. Consider adding this to your .zshrc
file so that it happens automatically in every session.
rvndsngwn
Updated on January 01, 2023Comments
-
rvndsngwn over 1 year
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running pod install... CocoaPods' output: ↳ CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
Error output from CocoaPods: ↳ WARNING: CocoaPods requires your terminal to be using UTF-8 encoding. Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError) from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in `unicode_normalize' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in `installation_root' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:226:in `podfile_path' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/user_interface/error_report.rb:105:in `markdown_podfile' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/user_interface/error_report.rb:30:in `report' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/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.0/lib/cocoapods/command.rb:52:in `run' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/bin/pod:55:in `<top (required)>' from /usr/local/bin/pod:23:in `load' from /usr/local/bin/pod:23:in `<main>' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError) from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in `unicode_normalize' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in `installation_root' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:226:in `podfile_path' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:205:in `podfile' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command.rb:160:in `verify_podfile_exists!' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command/install.rb:46: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.0/lib/cocoapods/command.rb:52:in `run' from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/bin/pod:55:in `<top (required)>' from /usr/local/bin/pod:23:in `load' from /usr/local/bin/pod:23:in `<main>'
Error running pod install Error launching application on iPhone 12 Pro Max.