CocoaPods requires your terminal to be using UTF-8 encoding

WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.

See https://github.com/CocoaPods/guides.cocoapods.org/issues/26 for

possible solutions.

 

one solution:

To prevent the invalid byte sequence in US-ASCII issue users should properly setup their environment to use UTF8:

export LC_ALL="en_US.UTF-8"

This thread highlights this common troubleshooting question.

other one (Recommended),

So there's two ways to approach this, which is reflected in the two types of answers here.

One is to make a permanent change to your environment by changing your shell configuration (e.g. .bashrc or locale defaults). So running this app on another machine will run into similar errors.

The other way is to change this setting as part of the build process of your app, so it will run successfully on any machine - but every time you create a new app using the Cocoapods plugin you'll need to add this script.

My preference is for the latter, so here's how to do that:

Edit your current build scheme - cmd-option-R

Expand Build, and select Pre-actions

Add a New Run Script Action

Then for your script, just add:

export LC_ALL="en_US.UTF-8"

This worked for me. It should look something like this:

enter image description here

原文地址:https://www.cnblogs.com/rosepotato/p/3695302.html