Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - CocoaPods requires your terminal to be using UTF-8 encoding - after latest flutter upgrade

Tags:

xcode

ios

flutter

I am getting this error after I upgraded flutter. Before upgrading everything was working normal on both iOS and android. Now my project is not building in iOS.

Below is my terminal info.

pod setup --verbose

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

export LANG=en_US.UTF-8

pod install --verbose

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

export LANG=en_US.UTF-8

[!] No `Podfile' found in the project directory.


/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:151:in `verify_podfile_exists!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:46:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

locale

LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
like image 795
shruti tupkari Avatar asked Dec 19 '19 08:12

shruti tupkari


2 Answers

open Terminal type open ~/.zshrc (or .profile if you don't use zsh)

It seems that LANG="en_US.UTF-8" alone isn't enough, you have to set

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

save the file

go back to Terminal

type source ~/.zshrc

type locale

You can now safely run pod update or pod install

like image 171
Job M Avatar answered Sep 27 '22 17:09

Job M


After one day of struggle finally i found the full solution

Follow these steps to solve this issue

  1. Unhide filles in Mac using Cmd + Shift + dot.
  2. Go to Macintosh HD -> User -> (Your user ).
  3. Search for .zshrc
  4. Open it with any editor (I recommend VS code)
  5. Under. #User configuration comment out export LANG=en_US.UTF-8.
  6. Open your flutter project and manually delete Pods folder, Podfile, Podfile.lock. (back-up all podfiles)
  7. Restart your Mac and run your flutter application
  8. Run pod install
  9. It will automatically create podfile and its new config in UTF - 8 encoding
  10. Enjoy and chill i got your back !!!!!
like image 29
J Jiju Thomas Avatar answered Sep 27 '22 17:09

J Jiju Thomas