How to resolve warning CocoaPods requires your terminal to be using UTF-8 encoding

You might have seen below warning while running flutter application on IOS simulator. Due to this issue, flutter application doesn’t get loaded & it becomes a hurdle to run the application.

Launching lib/main.dart on iPhone 14 Pro Max in debug mode…

Running pod install…

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.12.1/lib/cocoapods/config.rb:166:in `unicode_normalize’

    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/config.rb:166:in `installation_root’

Let’s consider, you have below applications are installed on your mac machine.

  • CocoaPods
  • Xcode
  • Flutter

To resolve the issue, first of all, lets check if .zshrc file present inside your user folder (i.e: Macintosh HD -> User -> <<Your user>>). It is a hidden file, to unhide it, press Cmd + Shift + dot

If this file is not present, create a new file with same name inside your user folder.

touch ~/.zshrc

Now the file will be available in your user folder.

Open the file.

vi .zshrc

Add/append below line inside the file if it is not present.

export LANG=en_US.UTF-8

Hit ESC button to get out and then type :wq! to save and quit.

Then go to the terminal & run below command,

source ~/.zshrc

Restart IOS simulator & android studio.

Run the application once again, hopefully this issue should be resolved now.

Leave a Reply

Your email address will not be published. Required fields are marked *

*