skip to Main Content

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)

4

Answers


  1. Chosen as BEST ANSWER

    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


  2. 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.

    Login or Signup to reply.
  3. I have had this issue and just fixed by downgrading the version of cocoapods to 1.10.2

    Login or Signup to reply.
  4. 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/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search