Build iOS unknown error: "invalid byte sequence in US-ASCII"

Hello, every1

After I’d tried to build my app to Apple Store with expo build:ios I got the following error:

Authentication with Apple Developer Portal failed!
Reason: Unknown reason, raw: “invalid byte sequence in US-ASCII”
Error: Reason: Unknown reason, raw: “invalid byte sequence in US-ASCII”
at runAction (/usr/local/lib/node_modules/expo-cli/src/appleApi/fastlane.ts:28:17)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at authenticate (/usr/local/lib/node_modules/expo-cli/src/appleApi/authenticate.ts:49:40)
at Context.ensureAppleCtx (/usr/local/lib/node_modules/expo-cli/src/credentials/context.ts:81:24)
at IOSBuilder.bestEffortAppleCtx (/usr/local/lib/node_modules/expo-cli/src/commands/build/ios/IOSBuilder.ts:95:14)
at IOSBuilder.prepareCredentials (/usr/local/lib/node_modules/expo-cli/src/commands/build/ios/IOSBuilder.ts:151:5)
at IOSBuilder.run (/usr/local/lib/node_modules/expo-cli/src/commands/build/ios/IOSBuilder.ts:62:7)
at IOSBuilder.command (/usr/local/lib/node_modules/expo-cli/src/commands/build/BaseBuilder.ts:39:7)
at Command. (/usr/local/lib/node_modules/expo-cli/src/exp.ts:332:7)

expo diagnostics:

Expo CLI 3.28.1 environment info:
System:
OS: macOS 10.15.7
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.6.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.8 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
npmPackages:
expo: ^39.0.0 => 39.0.3
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz => 0.63.2
react-native-web: ~0.13.7 => 0.13.18
npmGlobalPackages:
expo-cli: 3.28.1
Expo Workflow: managed

Could someone provide me information on how to fix this, please?

@ccheever, @charliecruzan, hi guys :wave:
Could someone help me with this, please?

Hi

Just a guess: Do you have any accented characters or other non-ASCII characters in your Apple developer username or password?

Try export LC_ALL="en_US.UTF-8"

2 Likes

Thanks, @jason-sitespace, I ran the following commands in terminal

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

and also added them to my ~/.bash_profile
but unfortunately the error

Authentication with Apple Developer Portal failed!
Reason: Unknown reason, raw: “invalid byte sequence in US-ASCII”

is still appears when using expo build:ios

@wodin, we had had ! symbol in the password before we changed the password and it was removed. Unfortunately, changing the password didn’t help to get rid of this error.
Have you got another idea?

@ccheever, @charliecruzan, please guys, could you help me? I’ve already uploaded app to Play Market but can’t build ipa with expo build:ios because of this error.

@kiramarks unfortunately I’m not sure what’s causing this error. As you can see from the stack trace, it seems to originate from fastlane so I think the best thing to do is look through issues there for a similar error message (like @jason-sitespace did) and try to figure out what caused the error in those situations and what the fix was

I would not expect ! to cause a problem.

What do you get if you run locale?

1 Like

What do you get if you run locale ?

Hmm, now I have this:

LC_COLLATE=“C”
LC_CTYPE=“C”
LC_MESSAGES=“C”
LC_MONETARY=“C”
LC_NUMERIC=“C”
LC_TIME=“C”
LC_ALL=

but, it is really strange because yesterday I had this after I ran export LC_ALL=en_US.UTF-8

LANG=""
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”

And now I have just put this command export LC_ALL=en_US.UTF-8 again and after that locale and the same information appears:

LANG=""
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”

@wodin, I have just realized that I ran this command in ~./local folder of my laptop, not in a project folder. I tried again this export LC_ALL=en_US.UTF-8 in the project folder and then expo build:ios and now I have this message instead of error:

Please enter the 6 digit code you received at +9** ••• ••• •• *0:

Seems like it disappeared :tada:

1 Like

It does not matter what directory you are in when you set those environment variables, but if you set them like that on the command line, they only apply to that session.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.