48
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??

5
  • 1
    update coca pod resolved my issue Commented Aug 31, 2021 at 22:38
  • 2
    Facing the same issue .... update coca pod didn't helped .... pod install not happening. any solution please ! Commented Sep 4, 2021 at 15:14
  • 1
    To me, it started after I updated cocoapods to latest 1.11.0. I had to downgrade it to 1.10.2 to "fix" it. Commented Sep 8, 2021 at 14:16
  • please update cocoa pod its solved Commented Sep 11, 2021 at 7:45
  • @Iqbal downgrade it to 1.10.2 didn't worked for me still getting the same error Commented Mar 10, 2022 at 11:05

10 Answers 10

139

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

Sign up to request clarification or add additional context in comments.

6 Comments

Excellent answer. Indeed, this is better than CocoaPods's own guidance, quoted above, which only indicates that LANG is to be set. Only by setting all locale settings ala this answer was my problem solved.
Unfortunately, it didn't help. "locale" command prints everything right, but I still get this error in Unity build with Google Dependency Resolver. Can't find what's wrong, so downgrading CocoaPods.
@luvjungle, I'd suggest verifying locale settings in the build environment itself by putting 'locale' invocation into the build pipeline, if you have not done this already. But it really may be something else in your case, I just described my investigation and solution that helped me.
Same problem with IntelliJ + Flutter, I can't find out what shell/env it's using to run the build commands, but neither .profile, nor .zshrc, nor .bashrc, nor IntelliJ's own terminal env settings matter....
@MarianTheisen I have the exact same problem. Only with IntelliJ + Flutter. Did you figure it out?
|
114

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

5 Comments

Thank you, these steps resolved the issue for me after I created the .profile and added this line. I was building from Unity for iOS.
this is great solution. Thank you. if you do not find . zshrc this file just use "vim" command and add export line. It will work like charm after android studio restart.
Was having issues in react-native ios folder. Thanks to this, got it working.
I had this issue for my React Native project after installing React Navigation library. These steps solved problem successfully! Thanks a lot.
I had to restart the AS after these steps. But the issue was solved! Thank you so much!
59

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

3 Comments

Had this issue compiling an iOS game from Unity version 2020.3.14f1. Happened right after I upgraded cocoapods / XCode / MacOS. This fixed it.
This works but sets your tooling back permanently. stackoverflow.com/a/69160445/1224741 is proper.
Worked like a charm. I've installed cocapods in external drive and was trying to uninstall/install in main drive.
16

I had the same problem but using React Native, the following worked for me(direct):

LANG=en_US.UTF-8 pod install

Comments

12

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

1 Comment

you saved my half day buddy. uninstalling and installing specific version helps me.
3

If you using cocoapods 1.12.1v

Add three lines below to three files : ~/.zshrc ; ~/.profile ; ~/.bash_profile and restart your mac

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Comments

2

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

Comments

2

I faced the same issue and I added export LANG=en_US.UTF-8 in my .profile also, tried all other options. Finally, I tried invalidating the cache and it worked for me.

Steps to invalidate the cache:

  1. Android Studio File->Invalidate Caches
  2. In the new pop-up check the box whichever you want to clear. Click Invalidate and Restart.

After the IDE restart, the pod install got succeeded.

1 Comment

Thanks! this saved my too much time. It's worked for me
1

if you have installed cocoapods using brew, run:

brew remove cocoapods

after that, install cocoapods using gem:

sudo gem install cocoapods -v 1.10.1

1 Comment

Wow! you are a genius . Finally my issue got solved, thank you :)
1

If you are experiencing this just with android studio, go to settings and change the configuration of the terminal Shell path.

  1. Open settings
  2. Search terminal or navigate to Tools -> Terminal
  3. Change the Shell Path from /bin/bash to /bin/zsh
  4. Apply and close

There is no need to uninstall anything.

Andriod studio terminal configuration

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.