Fastlane:[altool] 错误:无法上传存档。无法获得用户名和密码授权

Lia*_*iam 33 ipa fastlane flutter fastlane-pilot app-store-connect

我尝试使用 Pilot 和以下命令通过 fastlane 将我的 flutter ipa 上传到 AppStore:

\n
bundle exec fastlane pilot upload --ipa ../build/ios/ipa/project.ipa\n
Run Code Online (Sandbox Code Playgroud)\n

当我运行此命令时,我遇到以下错误

\n

我的 private_keys 文件夹中有一个 .p8

\n

似乎 Pilot 可以使用我的 Apple ID 登录我,但就在它抛出我无法获得授权之后。

\n

失败后,当我转到 TestFlight 时,我可以看到可用的新版本,但具有旧版本名称(例如 1.0.0 而不是 1.0.1)

\n
[monsieur_x | ~/project/ios ]$ bundle exec fastlane pilot upload --ipa ../build/ios/ipa/project.ipa\n[\xe2\x9c\x94]  \n[17:54:31]: Login to App Store Connect (apple_id@gmail.com)\n[17:54:33]: Login successful\n[17:54:35]: Ready to upload new build to TestFlight (App: 1544671867)...\n[17:54:39]: Going to upload updated app to App Store Connect\n[17:54:39]: This might take a few minutes. Please don\'t interrupt the script.\n[17:54:41]: [altool] 2022-10-26 17:54:41.294 *** Error: Unable to upload archive. Failed to get authorization for username \'apple_id@gmail.com\' and password. (\n\n[17:54:41]: [altool]     "Error Domain=NSCocoaErrorDomain Code=0 \\"Status code: 0\\" UserInfo={NSLocalizedDescription=Status code: 0, NSLocalizedFailureReason=The auth server returned a bad status code.}"\n\n[17:54:41]: [altool] ) (-1011)\n\n[17:54:41]: [altool]  {\n\n[17:54:41]: [altool]     NSLocalizedDescription = "Unable to upload archive.";\n\n[17:54:41]: [altool]     NSLocalizedFailureReason = "Failed to get authorization for username \'apple_id@gmail.com\' and password. (\\n    \\"Error Domain=NSCocoaErrorDomain Code=0 \\\\\\"Status code: 0\\\\\\" UserInfo={NSLocalizedDescription=Status code: 0, NSLocalizedFailureReason=The auth server returned a bad status code.}\\"\\n)";\n\n[17:54:41]: [altool] }\n\n[17:54:41]: Application Loader output above ^\n[17:54:41]: Error uploading \'/var/folders/gr/z1j06nhs2sd38gwv4_l51rj40000gn/T/7d36fd34-357d-4c08-aa9d-7db6ed3a8b82.ipa\'.\n[17:54:41]: Unable to upload archive. Failed to get authorization for username \'apple_id@gmail.com\' and password. (\n[17:54:41]: The call to the altool completed with a non-zero exit status: 1. This indicates a failure.\n[17:54:41]: Could not download/upload from App Store Connect!\n\n[!] Error uploading ipa file: \n [Application Loader Error Output]: Error uploading \'/var/folders/gr/z1j06nhs2sd38gwv4_l51rj40000gn/T/7d36fd34-357d-4c08-aa9d-7db6ed3a8b82.ipa\'.\n[Application Loader Error Output]: Unable to upload archive. Failed to get authorization for username \'apple_id@gmail.com\' and password. (\n[Application Loader Error Output]: The call to the altool completed with a non-zero exit status: 1. This indicates a failure.\n\n
Run Code Online (Sandbox Code Playgroud)\n

如果您需要,这是我的 fastlane 环境:

\n
<details><summary> fastlane environment </summary>\n\n### Stack\n\n| Key                         | Value                                                          |\n| --------------------------- | -------------------------------------------------------------- |\n| OS                          | 12.6                                                           |\n| Ruby                        | 2.6.8                                                          |\n| Bundler?                    | false                                                          |\n| Git                         | git version 2.38.0                                             |\n| Installation Source         | /usr/local/bin/fastlane                                        |\n| Host                        | macOS 12.6 (21G115)                                            |\n| Ruby Lib Dir                | /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib |\n| OpenSSL Version             | LibreSSL 2.8.3                                                 |\n| Is contained                | false                                                          |\n| Is homebrew                 | false                                                          |\n| Is installed via Fabric.app | false                                                          |\n| Xcode Path                  | /Applications/Xcode.app/Contents/Developer/                    |\n| Xcode Version               | 14.0.1                                                         |\n| Swift Version               | 5.7                                                            |\n\n\n### System Locale\n\n| Error                       |\n| --------------------------- |\n| No Locale with UTF8 found  |\n\n\n### fastlane files:\n\n<details><summary>`./fastlane/Fastfile`</summary>\n
Run Code Online (Sandbox Code Playgroud)\n
bundle exec fastlane pilot upload --ipa ../build/ios/ipa/project.ipa\n
Run Code Online (Sandbox Code Playgroud)\n\n`./fastlane/Appfile`\n
[monsieur_x | ~/project/ios ]$ bundle exec fastlane pilot upload --ipa ../build/ios/ipa/project.ipa\n[\xe2\x9c\x94]  \n[17:54:31]: Login to App Store Connect (apple_id@gmail.com)\n[17:54:33]: Login successful\n[17:54:35]: Ready to upload new build to TestFlight (App: 1544671867)...\n[17:54:39]: Going to upload updated app to App Store Connect\n[17:54:39]: This might take a few minutes. Please don\'t interrupt the script.\n[17:54:41]: [altool] 2022-10-26 17:54:41.294 *** Error: Unable to upload archive. Failed to get authorization for username \'apple_id@gmail.com\' and password. (\n\n[17:54:41]: [altool]     "Error Domain=NSCocoaErrorDomain Code=0 \\"Status code: 0\\" UserInfo={NSLocalizedDescription=Status code: 0, NSLocalizedFailureReason=The auth server returned a bad status code.}"\n\n[17:54:41]: [altool] ) (-1011)\n\n[17:54:41]: [altool]  {\n\n[17:54:41]: [altool]     NSLocalizedDescription = "Unable to upload archive.";\n\n[17:54:41]: [altool]     NSLocalizedFailureReason = "Failed to get authorization for username \'apple_id@gmail.com\' and password. (\\n    \\"Error Domain=NSCocoaErrorDomain Code=0 \\\\\\"Status code: 0\\\\\\" UserInfo={NSLocalizedDescription=Status code: 0, NSLocalizedFailureReason=The auth server returned a bad status code.}\\"\\n)";\n\n[17:54:41]: [altool] }\n\n[17:54:41]: Application Loader output above ^\n[17:54:41]: Error uploading \'/var/folders/gr/z1j06nhs2sd38gwv4_l51rj40000gn/T/7d36fd34-357d-4c08-aa9d-7db6ed3a8b82.ipa\'.\n[17:54:41]: Unable to upload archive. Failed to get authorization for username \'apple_id@gmail.com\' and password. (\n[17:54:41]: The call to the altool completed with a non-zero exit status: 1. This indicates a failure.\n[17:54:41]: Could not download/upload from App Store Connect!\n\n[!] Error uploading ipa file: \n [Application Loader Error Output]: Error uploading \'/var/folders/gr/z1j06nhs2sd38gwv4_l51rj40000gn/T/7d36fd34-357d-4c08-aa9d-7db6ed3a8b82.ipa\'.\n[Application Loader Error Output]: Unable to upload archive. Failed to get authorization for username \'apple_id@gmail.com\' and password. (\n[Application Loader Error Output]: The call to the altool completed with a non-zero exit status: 1. This indicates a failure.\n\n
Run Code Online (Sandbox Code Playgroud)\n\n

快车道宝石

\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
宝石版本更新状态
快车道2.210.1\xe2\x9c\x85 最新
\n

加载的 fastlane 插件:

\n

没有加载任何插件

\n已加载宝石\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n
宝石版本
你的意思1.3.0
阿托莫斯0.1.3
彩色23.1.2
纳奈莫0.3.0
重新XML3.2.5
xcode项目1.21.0
胭脂2.0.7
美丽的0.3.0
终端通知程序2.0.0
unicode-显示宽度1.8.0
终端表1.8.0
列表3.6.0
公共后缀4.0.6
可寻址的2.8.0
多部分帖子2.0.0
自动换行1.0.0
优化分析0.1.1
tty 屏幕0.8.1
tty 光标0.7.1
tty 旋转器0.9.3
人工制品3.0.15
巴博萨1.0.4
有色1.2
高线2.0.3
指挥官4.6.0
外控0.92.2
法拉第-em_http1.0.0
法拉第同步1.0.0
法拉第-Excon1.1.0
Faraday-httpclient1.0.1
法拉第多部分1.0.3
法拉第网_http1.0.1
Faraday-net_http_persistent1.2.0
法拉第赞助人1.0.0
法拉第架1.0.0
法拉第重试1.0.3
ruby2_关键字0.0.5
法拉第1.10.0
unf_ext0.0.8.1
联合国基金会0.1.4
域名0.5.20190701
http-cookie1.0.4
法拉第cookie_jar0.0.7
Faraday_中间件1.2.0
快速图像2.2.6
gh_检查员1.1.3
迷你魔法4.11.0
自然2.2.1
红宝石压缩包2.3.2
安全0.1.3
xcpretty-travis-格式化程序1.0.1
多滕夫2.7.6
捆绑器2.3.10
模拟控制1.6.8
杰威特2.3.0
优步0.1.0
陈述性的0.0.20
开拓者选项0.1.2
可代表的3.1.1
可重审的3.1.2
迷你哑剧1.1.2
备忘录者0.16.2
多json1.15.0
操作系统1.1.4
印章0.16.1
谷歌认证1.1.2
http客户端2.8.3
谷歌 API 核心0.4.2
google-apis-playcustomapp_v10.7.0
google-apis-androidpublisher_v30.17.0
谷歌云环境1.6.0
谷歌云错误1.2.0
谷歌云核心1.6.0
google-apis-iamcredentials_v10.10.0
google-apis-storage_v10.11.0
摘要CRC0.6.4
谷歌云存储1.36.1
表情符号_正则表达式3.2.3
jmes路径1.6.1
aws-分区1.572.0
AWS 事件流1.2.0
AWS-sigv41.4.0
aws-sdk-核心3.130.0
aws-sdk-kms1.55.0
AWS-SDK-S31.113.0
CF属性列表3.0.5
克莱德1.1.0
json2.6.1
韦伯里克1.7.0
13.0.6
可转发的1.2.0
记录器1.3.0
日期2.0.0
斯特林吉奥0.0.2
ip地址1.2.2
开放式SSL2.1.2
兹库1.0.0
互斥锁_m0.1.0
破坏0.1.0
字符串扫描1.0.0
io控制台0.4.7
文件工具1.1.0
ETC1.0.1
libxml-ruby3.2.1
心理3.1.0
\n
\n

生成于: 2022-10-27

\n\n

有人有主意吗?

\n

谢谢 !

\n

ale*_*ras 77

您好,我为这个问题苦苦挣扎了很多天。

解决方案

步骤1

转到https://appleid.apple.com/account/manage登录并转到应用程序特定密码,生成新的应用程序特定密码后将其复制。

第2步

在 fastlane 文件夹内创建一个新文件 .env.default 并添加两个属性。

FASTLANE_USER=<Apple USER ID>
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD=<App-Specific Password>
Run Code Online (Sandbox Code Playgroud)

使用应用程序专用密码登录非 Apple 提供的应用程序或服务,例如 fastlane。

------------------------------------------其他选项------------------ --------------

您不仅可以使用 .env 文件,还有不同的选择。

1-在您的快速文件中

FASTLANE_USER=<Apple USER ID>
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD=<App-Specific Password>

lane :beta do
  crashlytics
end
Run Code Online (Sandbox Code Playgroud)

2-Bash 简介

nano ~/.bash_profile
Run Code Online (Sandbox Code Playgroud)

插入您的属性

FASTLANE_USER=<Apple USER ID>
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD=<App-SpecificPassword>
Run Code Online (Sandbox Code Playgroud)

CTRL + X - 保存更改。重新打开你的终端

请检查链接以了解更多详细信息。 https://docs.fastlane.tools/best-practices/keys/