'Unicode Normalization not appropriate for ASCII-8BIT

13: from /usr/local/bin/pod:23:in `<main>'
12: from /usr/local/bin/pod:23:in `load'
11: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/bin/pod:55:in `<top (required)>'
10: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/command.rb:52:in `run'
9: from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
8: from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
7: from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
6: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/command.rb:66:in `report_error'
5: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/user_interface/error_report.rb:30:in `report'
4: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/user_interface/error_report.rb:105:in `markdown_podfile'
3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/config.rb:226:in `podfile_path'
2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/config.rb:166:in `installation_root'
1: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/config.rb:166:in `unicode_normalize'
/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)

I am Facing these errors, don't know why when I run pod update it gives me this error. Any solution??



Solution 1:[1]

I fixed it doing this:

I uninstalled completely cocoapods (my version was 1.11.0)

gem list --local | grep cocoapods

cocoapods-core (1.11.0) cocoapods-deintegrate (1.0.5) cocoapods-downloader (1.5.0) cocoapods-plugins (1.0.0) cocoapods-search (1.0.1) cocoapods-trunk (1.6.0) cocoapods-try (1.2.0)

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

Then i installed cocoapods version 1.10.1 (you can try with more versions under 1.11.0 if you need)

sudo gem install cocoapods -v 1.10.1

Solution 2:[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.

You can run 'locale' in the terminal to check current locale settings. It should be something like this:

LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

If you have ascii-based locales set or "C" (which is also an ascii locale) then run

export LC_ALL=en_US.UTF-8

If you prefer some other locale (not en_US) then run locale -a to see the list of available options and pick UTF-8 locale you prefer.

Actually CocoaPods warns that UTF-8 locale is required:

WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
    Consider adding the following to ~/.profile:

    export LANG=en_US.UTF-8

But before 1.11.0 it was required only in case you use pods which contain non-ascii symbols in their names (Chinese for example) but starting 1.11.0 it become more strict. There is a discussion on Cocoapods GitHub about it: https://github.com/CocoaPods/CocoaPods/issues/10939

Solution 3:[3]

The answer of Vyacheslav Kormushkin worked for me.

Concretely, what I did was:

  • open Terminal
  • type open ~/.zshrc (or .profile if you don't use zsh)
  • add export LC_ALL=en_US.UTF-8, and save the file
  • go back to Terminal
  • type source ~/.zshrc
  • type locale

==> The locale will now be fixed

==> You can now safely run pod update or pod install

Solution 4:[4]

If you are here because of the failure outputs from Github actions. Try my solution:

add this to the top level of your github workflow yml file:

env:
  LANG: en_US.UTF-8

ref: https://docs.github.com/en/actions/learn-github-actions/environment-variables

Solution 5:[5]

First solution is, to remove your current version of the cocoapods and rolling back to 1.10.2

To remove your current version, you could just run:

sudo gem uninstall cocoapods

then you can install the 1.10.2 version of cocoa pods via the following command:

sudo gem install cocoapods -v 1.10.2

The second solution is, to install the cocoapods via Homebrew with the following command:

brew install cocoapods

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Viacheslav Kormushkin
Solution 3 dotdotcommadot
Solution 4 johnny
Solution 5 Sreeraj VR