在执行expo build:ios时,Apple Developer Portal中出现身份验证失败。

8

我正在尝试使用Gitlab-CI自动配置通过Expo构建iOS应用的过程。以下是我正在使用的命令:

expo login -u expo_user -p expo_pass
expo build:ios --non-interactive --apple-id my_id@domain.com --clear-dist-cert --clear-provisioning-profile --dist-p12-path "path_to_file.p12" --provisioning-profile-path "path_to_file.mobileprovision"

我已经传递了这些环境变量的相应值:

EXPO_APPLE_PASSWORD
EXPO_IOS_DIST_P12_PASSWORD

在第二个命令执行期间,它会启动这些日志:

[14:24:23] Trying to authenticate with Apple Developer Portal...
[14:24:25] Authentication with Apple Developer Portal failed!
[14:24:25] Error: Reason: Unknown reason, raw: "<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>Apple</center>\r\n</body>\r\n</html>\r\n\n"
    at runAction (/expo-cli@3.13.1/src/appleApi/fastlane.ts:28:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Object.authenticate (/expo-cli@3.13.1/src/appleApi/authenticate.ts:46:40)
    at IOSBuilder.getAppleCtx (/expo-cli@3.13.1/src/commands/build/ios/IOSBuilder.js:47:23)
    at IOSBuilder.produceMissingCredentials (/expo-cli@3.13.1/src/commands/build/ios/IOSBuilder.js:123:22)
    at IOSBuilder.prepareCredentials (/expo-cli@3.13.1/src/commands/build/ios/IOSBuilder.js:65:7)
    at IOSBuilder.run (/expo-cli@3.13.1/src/commands/build/ios/IOSBuilder.js:19:7)
    at IOSBuilder.command (/expo-cli@3.13.1/src/commands/build/BaseBuilder.js:55:7)
    at Command.<anonymous> (/expo-cli@3.13.1/src/exp.ts:81:7)

我使用的Apple Developer账户已配置了双因素认证(2FA)。这就是为什么expo build:ios 命令在验证Apple Portal时失败的原因吗?我在这些命令中缺少什么?
PS:这些命令在我的笔记本电脑上可以正常工作!

你找到解决方案了吗? - Omar Diaa
我也遇到了同样的问题,目前为止没有任何建议的解决方案适用于我。我也在考虑这是否与双因素认证有关。 - stefanS
4个回答

2

在我的开发机上,我在交互模式下遇到了类似的问题。

有一件事情对我起作用,那就是在隐身窗口中登录App Store Connect以触发2FA。不确定这是否巧合,但它确实起作用了!

供参考,我在最新的expo-cli@4.9.1上遇到了类似的错误。

✖ Logging in...
Authentication with Apple Developer Portal failed!
    Error: Apple Service Error -1018. Could Not Complete Request. Your request could not be completed because of an error. Please try again later. Apple servers may be down right
    now, please try again in about 10-20 minutes

0
除了其他答案之外,还要确保未激活VPN或网站屏蔽软件,这是我遇到问题的原因。

-1

这不是一个非常令人满意的答案,但对我来说有效: 删除你的node_modules文件夹,然后重新安装所有依赖项。

上周我们没有问题,但今天我们一直遇到这个错误。

只要你有一个yarn.lock或者NPM的等效文件,以确保你下载的版本与原始版本匹配,这个可能的修复方案就没有任何风险。


-4

请注意,expo build:ios -c 将会 -c, --clear-credentials 清除在 Expo 服务器上存储的所有凭据。 - Dimitri Kopriwa

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接