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

Viewed 6591

I am having a rather weird day. I get this error whenever I try to run my app on iOS simulator from Android Studio

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

export LANG=en_US.UTF-8

At this point on Xcode, I begin to get the error

Error: "The sandbox is not in sync with the Podfile.lock..."

when I try to build on Xcode. However, I am able to build successfully on Xcode and run on my emulator after the following fixes

 1. $pod deintegrate --verbose
 2. $pod install --verbose

Going back to Android Studio, I get my initial error again and so I keep going in circles

flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.2.0, on macOS 11.2.3 20D91 darwin-x64, locale en-NG) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [!] Android Studio ✗ Unable to find bundled Java version. [✓] Android Studio (version 4.1) [✓] IntelliJ IDEA Community Edition (version 2021.2.1) [✓] Connected device (1 available)

3 Answers

just change your cocoapos version to 1.10.2 to solve your problem.

first uninstall your current version (whatever it is)

In my case, i downgraded from version 1.11.1

sudo gem uninstall cocoapods

Then just install the stable version (as of Nov 11, 2021)

sudo gem install cocoapods:1.10.2

and build your app again.

If still not working , delete the below from the build directory:

  • Podfile
  • Podfile.lock
  • Pods (directory) and build.

It fixed it for me, twice in the last few days.

After trying every solution I could lay my hands on, I figured it was a problem with Android studio and I fixed by completely uninstalling and reinstalling AS

I have had this issue and just fixed by downgrading the version of cocoapods to 1.10.2

Related