Authentication with Apple Developer Portal failed!

Hey,

I’ve been trying to run expo build:ios to run on my Windows 10 Pro machine and everytime, after i enter my Apple Dev credentials (I’ve tried multiple times, different ways just to be sure that i’ve used the correct information) I get this error log:

Trying to authenticate with Apple Developer Portal...
Authentication with Apple Developer Portal failed!
?[31mbash exited with non-zero code: 127?[39m
?[31m?[90mSet EXPO_DEBUG=true in your env to view the stack trace.?[31m?[39m
?[?25h

I’ve tried with both the latest 3.0.10 and 3.0.4 version.
I’ve tried to switch from my home network to my mobile network (phone).
I’ve tried to do a reboot.
I did follow all windows specific instructions in the documentation (WSL).
I’ve looked through forums.expo.io to find a solution but could only find multiple similar issues without a solution. (I.e. this seems to be an older problem expo which has not been fixed yet?)

My expo diagnostics is:

  Expo CLI 3.0.4 environment info:
    System:
      OS: Windows 10
    Binaries:
      Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  3.3.0.0 AI-182.5107.16.33.5264788

Running expo doctor shows “Didn’t find any issues with your project!”.
Running expo whoami shows my username.
Running expo client:ios shows the same error.

I can, however, log in online to Apple dev using my credentials.

What’s wrong here?

Update:
When downgrading to expo 2.6.14 it seems to work. Shortly after inserting my credentials, I see these logs:

? What's your Apple ID? xxx@xxx.com
? Password? [hidden]
[11:20:54] Validating Credentials...
[11:20:59] Only 1 team associated with your account, using Team ID: DFxxCGxx3
? Will you provide your own Distribution Certificate? Let Expo handle the process
? Will you provide your own Push Certificate? Let Expo handle the process

I.e. I’ve got logged in, otherwise Expo couldn’t display the Team ID, right?
So, something is wrong with v3.

1 Like

Hi! Sorry you’re running into this- although it looks like in other similar posts, the fix was running the command in Powershell. Can you try that and lmk if the issue persists?

2 Likes

I am running into the same problem. I have a Windows 10 that I am trying to build an ios version. I do have an apple developers account and can login. Here is the expo diagnostics

Expo CLI 3.0.10 environment info:
    System:
      OS: Windows 10
    Binaries:
      Yarn: 1.16.0 - C:\Users\mattt\AppData\Roaming\npm\yarn.CMD
      npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  3.4.0.0 AI-183.6156.11.34.5522156

I got all the same answers above when I run expo doctor and expo whoami. I have also tested the app through expo using expo on an ipad and it works. I have run WindowsPowershell as an administrator and get the following error when I run expo build:ios. The same error appears if I run it from the Windows Command prompt.

Trying to authenticate with Apple Developer Portal...
Authentication with Apple Developer Portal failed!
bash exited with non-zero code: 2

I followed what the user did above and downgraded to version 2.6.14 and I was able to get further in the process. Expo 2.6.14 authenticated the credentials with Apple and made the certifications and also a profile. Once again on Windows PowerShell and the Command Prompt I would get the following error halting the process.

[08:14:47] Error while gathering & validating credentials
[08:14:47] Error: Request failed with status code 400
[08:14:47] Request failed with status code 400

I have been searching for the status code 400 error but there does not seem to be any answers. I am unable to build an ios app with either 3.0.10 or 2.6.14. Any help would be appreciated on how to finish this build. Thanks.

Can you run those commands with EXPO_DEBUG=true? Also, make sure you have WSL enabled:

You can follow the installation guide here. We recommend picking Ubuntu from the Windows Store. Be sure to launch Ubuntu at least once. After that, use an Admin powershell to run: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Thanks for your help. I already installed Ubuntu from the Windows App Store. I went ahead and reran the command in PowerShell and here is everything from the my session.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\WINDOWS\system32> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux


Path          :
Online        : True
RestartNeeded : False



PS C:\WINDOWS\system32> cd C:\Users\matt\Documents\reactprojects\MatchWellness\
PS C:\Users\matt\Documents\reactprojects\MatchWellness> set EXPO_DEBUG=true
PS C:\Users\matt\Documents\reactprojects\MatchWellness> expo build:ios
Checking if there is a build in progress...

Please enter your Apple Developer Program account credentials. These credentials are needed to manage certificates, keys and provisioning profiles in your Apple Developer account.
The password is only used to authenticate with Apple and never stored.
? Apple ID: XXXXX
? Password (for XXXXX): [hidden]
Trying to authenticate with Apple Developer Portal...
Authentication with Apple Developer Portal failed!
bash exited with non-zero code: 2
Set EXPO_DEBUG=true in your env to view the stack trace.
PS C:\Users\matt\Documents\reactprojects\MatchWellness> expo -V
3.0.10
PS C:\Users\matt\Documents\reactprojects\MatchWellness>

So I ran this again on the Command Prompt and got some more information that did not show up in the PowerShell window.

Trying to authenticate with Apple Developer Portal...
Authentication with Apple Developer Portal failed!
bash exited with non-zero code: 2
Error: bash exited with non-zero code: 2
    at ChildProcess.completionListener (C:\Users\matt\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:65:13)
    at Object.onceWrapper (events.js:277:13)
    at ChildProcess.emit (events.js:189:13)
    at ChildProcess.cp.emit (C:\Users\matt\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (internal/child_process.js:970:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
    ...
    at spawnAsync (C:\Users\matt\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:26:19)
    at runAction (C:\expo-cli@3.0.10\src\commands\build\ios\appleApi\fastlane.js:16:28)
    at Object.authenticate (C:\expo-cli@3.0.10\src\commands\build\ios\appleApi\authenticate.js:15:46)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Maybe this can you some more information about 3.0.10 that is not working.

I got the exact same problem with authentication, tried both newest expo-cli 2.* and 3.* without any luck, i get an exit code 127, and the same stacktrace as @tfawcet, with spawnAsync.ts

Any one who had luck resolving it?

2 Likes

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