Flutter iOS App Building Problem "CocoaPods requires your terminal to be using UTF-8 encoding"
After another update, trying to build Flutter app for iOS started throwing an error:
WARNING: CocoaPods requires your terminal to be using UTF-8 encoding. Consider adding the following to ~/.profile: export LANG=en_US.UTF-8
And refusing to build.
After some search and failing attempts to solve it, I finally managed to get it right.
Basically as this bugreport says,
~/.zshrc (depending on default shell) should be updated with following:
export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export LC_ALL=en_US.UTF-8
Tricky parts are:
- error message mentions only
LANG=en_US.UTF-8, but it actually should be all 3
- it has to be in
~/.bash_profileand NOT in
~/.bash_profilehas to be functional (try it with
source ~/.bash_profileand see that variables were set) - in my case it was long neglected because I mostly used
~/.profileand so it was not operational till I removed unused stuff
Hope I remember this blog post next time it happens, as this is already a second time and I had to Google it all over again.