skip to Main Content

Hello when I try to build or run my iOS app on a emulator device on Mac m1 I have this issue with fastlane on Xcode.

31mWARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables[0m
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:43:in `match?': [31m[!] invalid byte sequence in US-ASCII[0m (ArgumentError)

When I go to the pathname.rb:43 I see this code but I don’t what is wrong

def chop_basename(path) # :nodoc:
base = File.basename(path)
if /A#{SEPARATOR_PAT}?z/o.match?(base)
  return nil
else
  return path[0, path.rindex(base)], base
end

end

I have my terminal locale like this

LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

How you can see all is in "en_US.UTF-8" but the Xcode show the same build error

2

Answers


  1. Chosen as BEST ANSWER

    The best way to solve this problem is install fastlane with brew. When I try to install other fastlane versions with ruby, any of a version presents the same problem or another problem. But the only thing that you can do is uninstall fastlane ruby installation. and install with brew. This is the commands that I implement.

    1. Uninstall Fastlane "sudo gem uninstall fastlane"
    2. Verify if fastlane doesn't exist with this command "gem query --local"
    3. Install with brew "brew install fastlane"

    This is the version that I have:

    Installation Source: /usr/local/Cellar/fastlane/2.207.0/libexec/bin/fastlane 
    Version: 2.207.0
    Xcode Version: 13.2.1
    Mac OS Version: 12.2
    Mac M1: Yes
    

  2. I encounter same issue when running fastlane in Terminal embedded in Android Studio.

    I fixed this by adding the following three variables into the shell environment:

    # file .zshrc
    # ...
    # ...
    export LANG=en_US.UTF-8
    export LANGUAGE=en_US.UTF-8
    export LC_ALL=en_US.UTF-8
    

    I use zsh, so the config file will be placed at ~/.zshrc by default.

    Depends on what shell you used and the path of config file may be different.

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