Reputation: 1439
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=
Upvotes: 113
Views: 132591
Reputation: 6022
Just open your terminal
and enter the below command
export LC_ALL=en_US.UTF-8
Upvotes: 3
Reputation: 667
Forget all these solutions. only in two steps
1- In your Android studio terminal "That's what I used", type
locale
2- Then It will display lists, type in your terminal again
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
And yeah. your problem has been solved :)
Upvotes: 1
Reputation: 51
1- open the required file
vim ~/.zshrc
2- add:
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
3- Restart the terminal:
source ~/.zshrc
4- Restart Android Studio
Upvotes: 5
Reputation: 1
Solution Working in my MacBook Pro 2023(14").
open Terminal
Run Command vim ~/.zshrc
Insert 2 Statements(Using i Key): export LC_ALL=en_US.UTF-8
| export LANG=en_US.UTF-8
Close & save it use Esc + :wq!
Run Command source ~/.zshrc
Now you're good to go
Upvotes: 0
Reputation: 41
Uninstall cocoapods Installed by brew
brew uninstall cocoapods
Installed with gem
sudo gem uninstall cocoapods
Install cocoapods version 1.10.2 (stable version)
sudo gem install cocoapods -v 1.10.2
When I install with this command, it report the following error You don't have write permissions into the /usr/bin directory To solve this error, I use the following command
sudo gem install cocoapods -v 1.10.2 -n /usr/local/bin
Upvotes: 0
Reputation: 173
Run this in the terminal
for mac users using zsh
echo 'export LANG=en_US.UTF-8' >> ~/.zprofile
source ~/.zprofile
for Linux users using bash
echo 'export LANG=en_US.UTF-8' >> ~/.bash_profile
source ~/.bash_profile
Upvotes: 1
Reputation: 11
To resolve this issue, you can follow the instructions in the warning message and add the following line to your ~/.profile file:
export LANG=en_US.UTF-8
This will set the encoding to UTF-8 for your terminal session, which should allow CocoaPods to work properly with your Flutter application.
After adding the line to your ~/.profile file, save the changes and run the following command to reload the profile:
For Bash
source ~/.profile
For Zsh
source ~/.zshrc
Upvotes: 1
Reputation: 19
I have figured out the latest solution that works fine in 2022
Open iOS folder in terminal
Run command pod install, and let the process complete.
pod install
This works fine, if not try restarting the device
Upvotes: -1
Reputation: 666
vim ~/.profile
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
source ~/.profile
Upvotes: 4
Reputation: 71
In my case, this error only occurs when I use the android Studio terminal to run the flutter ios app. so instead, I used Mac Terminal to run the flutter ios app, and it's working perfectly fine.
To run the flutter app from the terminal use the below command:
flutter run
Upvotes: 1
Reputation: 151
Solving Cocoapods UTF-8 error: (Detailed explanation)
We need to change the locale of the terminal to UTF-8.
Step 1: Open the terminal, type locale, press enter, and check what locale it shows.
Step 2: If it's a bash terminal, change it to a zsh terminal,
Step 3: Then open finder, go to mac HD, users, folder with your username, and press command+shift+. to open hidden files
Step 4: Create or open a file named .zshrc
Step 5: Paste this there:
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Step 6: Save it by command + s
Step 7: Then open the terminal again and check by typing, locale and pressing enter (Then you can either keep it open or close the terminal)
Step 8: If it shows some other locale instead of UTF-8, then paste the below 3 lines and press enter:
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Step 9: Then open Android Studio, go to the terminal and paste the same above 3 lines, and press enter
Step 10: Then on your project file, go to the ios folder, right-click on it, and open in the terminal, then in the terminal, do paste the same above 3 lines and press enter
Step 11: Now you can install pods in this terminal by typing, pod install.
Now it will work, if you still get the same error, go to tools -> flutter -> flutter clean and restart android studio by clicking on File -> restart ide or a similar one.
Then on your project, right-click on the ios folder and open the terminal, type locale, and press enter, if it's not in UTF-8 now, then from step 9 again up to step 11, it will work now. You can run your app on iOS devices now.
My repo -> https://github.com/anantha-eswar/
Upvotes: 9
Reputation: 3958
open ~/.zshrc
(or open ~/.profile
if you don't use zsh)It seems that LANG="en_US.UTF-8"
alone isn't enough, so 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 and type source ~/.zshrc
and type locale
You can now safely run pod update or pod install
Upvotes: 274
Reputation: 306
if you use Android Studio, then open terminal in it with:
nano ~/.profile
add these values:
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
and it's very important: now you need to close Android Studio and open it again, then you will be able to make a project
Upvotes: 2
Reputation: 655
Changing the .zshrc
file didn't work for me, so I ended up with executing the cmd with specific language UTF-8 definition:
$ LANG=en_US.UTF-8 <pod command>
Source: cocoaPods issue
Upvotes: 0
Reputation: 1
I had this problem only in android studio. When I switched to the terminal outside Android Studio it worked fine.
Upvotes: 0
Reputation: 11
After upgrading mac os big sur version I get this error when I try to build ios unity.
If you don't have the file .profile, you can create new file .profile in /Users/"user-name"/.profile
step 1: open terminal. create new file .profile
$ cd
$ touch .profile
step 2: edit .profile.add
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
in .profile
Upvotes: 1
Reputation: 1549
In my case the following needed to be added to .bash_profile
instead of the other suggested files.
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Upvotes: 6
Reputation: 2381
To iterate on Shruti Tupkari's answer ~ To add in export LANG=en_US.UTF-8
to your terminal it needs to be added to a profile such as .zshrc
, .bashrc
, or .bash_profile
.
To do this simply use vim
So try
vim .zshrc
This should open up your .zshrc
profile. Type 'i' to insert something.
Then simply paste in export LANG=en_US.UTF-8
hit esc to get out and then type :wq
to save and quit
Try and run your app again. If you get the error, repeat the same steps on the other profiles in your computer.
Here's some information on how to use vim
https://www.howtoforge.com/vim-basics
Upvotes: 10
Reputation: 1
To fix this, you might want to find either your ~/.bash_profile (for bash) or ~/.zshrc (for zsh) and add the export line that you put in your ~/.profile export LANG=en_US.UTF-8
That was all I had to do.
Upvotes: 0
Reputation: 1439
finally i have solved this with below steps
flutter build ios
and Solved.
Upvotes: 12
Reputation: 1347
If adding export LANG=en_US.UTF-8
doesn't help, try export LC_ALL="en_US.UTF-8"
Credits: https://github.com/CocoaPods/CocoaPods/issues/6333#issuecomment-551052399
Upvotes: 6
Reputation: 619
flutter clean
vim .zshrc
in your terminal. This should open up your .zshrc
profile. Type I
to insert something. Then, simply paste in export LANG=en_US.UTF-8
and hit ESC to get out and then type :wq
to save and quit.pod install
# platform :ios, '9.0' to
platform :ios, '10.0'flutter build iOS
in the main root project through the terminal.flutter run
If you are facing a problem with Flutter. Try this solution
flutter clean
flutter build ios
Upvotes: 20
Reputation: 1729
The proper solution, without re-installing anything, can be found:
The crux is to use export LC_ALL=en_US.UTF-8
.
The links above explain how to do that.
Upvotes: 3
Reputation: 539
Follow these steps to solve this issue
Cmd + Shift + dot
..zshrc
#User configuration
comment out export LANG=en_US.UTF-8
.pod install
Upvotes: 42