Fastlane 失败,报错为“无法获取内容提供者公共 ID,请使用 -asc_provider 选项指定提供者简称。”

31

我使用Fastlane创建了一个iOS测试版构建,但出现了一个奇怪的错误。我不确定原因,因为昨天还能正常工作,而且没有对Fastlane配置进行任何更改。在上传构建到苹果应用商店时,它突然出现了错误。

错误信息如下:

[21:50:01]: Transporter transfer failed.
[21:50:01]: 
[21:50:01]: Cannot obtain the content provider public id. Please specify a provider short name using the -asc_provider option.

[21:50:02]: Cannot obtain the content provider public id. Please specify a provider short name using the -asc_provider option.
Return status of iTunes Transporter was 1: Cannot obtain the content provider public id. Please specify a provider short name using the -asc_provider option.
The call to the iTMSTransporter completed with a non-zero exit status: 1. This indicates a failure.

[21:50:02]: Error uploading ipa file: 


[21:50:02]: fastlane finished with errors

[!] Error uploading ipa file:

请参考下面的日志 在此输入图片描述


1
使用 --verbose 参数运行 fastlane,查看详细日志以确定问题更加清晰。 - timbre timbre
1
哦,还有:“如果您在多个App Store Connect团队中,请注意iTunes Transporter可能需要提供者简称以知道上传二进制文件的位置。pilot将尝试使用所选团队的长名称来检测提供者简称。要使用显式值覆盖检测到的值,请使用itc_provider选项。”(来源:https://docs.fastlane.tools/actions/testflight/) - timbre timbre
3
如果可以的话,请不要展示代码图片。我相信你可以从fastlane日志中复制出来,将其作为代码文字粘贴到问题中。 - matt
请参考此处的内容,了解为什么应该使用文本而不是文本图像。在编辑后,请将此评论和其他与图像相关的评论标记为“不再需要”。 - rainbow.gekota
7个回答

16

对于那些在Azure Devops的AppStoreRelease任务中遇到问题的人。使用@user20291554的解决方案,可以按照以下方式修复

 - job: ios
    pool:
      vmImage: macOS-latest
    variables:
      DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS: "-asc_provider <your team ID or short name if different>"
    steps:
      ...
      - task: AppStoreRelease@1
        inputs:
      ...

我们可以在变量组 variables: - group: App Variables 中提及 DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS 吗? - Sagar
@Sagar 是的,对我来说在变量组中也起作用了。名称:"DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"。值:"-asc_provider 12345",其中12345是您的团队ID。 - K232
@K232,我能否将此添加到Azure库变量组中,而不是.YML文件中。我收到了“用户名xyz.com不是提供者12345的成员”的错误提示。 - Sagar
对于那些使用旧版“classic”发布管道的用户,在“variables”选项卡下添加变量,并省略值周围的双引号-这对我很有效。 - jimmycliffface

10
请在下面的代码行中添加itc_providerapple_id
upload_to_testflight(
    skip_waiting_for_build_processing: true,
    apple_id: "APPLE_ID",
    itc_provider:"ID" #example: W4A0P2BYMN
)

如果您在多个App Store Connect团队上,Deliver需要提供程序提供商的短名称以了解在哪里上传您的二进制文件。Deliver将尝试使用所选团队的长名称来检测提供程序的短名称。要使用显式值覆盖检测到的值,请使用itc_provider选项。


在 Azure Pipeline 中,我们可以添加 ID。 - Sagar

7

对我来说,添加环境变量完美地解决了这个问题:

ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD: true

就我的情况而言,这里有一个Azure DevOps流水线的示例:

- task: AppStoreRelease@1
    env:
        ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD: true
    ...

来源 Fastlane GitHub 问题


7

我也遇到了同样的问题。

这个来自Github的评论帮助了我。

在你的部署(或本地机器,或Fastfile文件)中添加环境变量。使用DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS,我们可以添加“缺失”的-asc_provider变量。

ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"] = "-asc_provider YourShortName" 刚刚部署成功了,对于那些迫不及待的人是有效的。


6

这是我是如何解决它的!


      deliver(
        app_identifier: '{{YOUR_APP_ID}}',
        submit_for_review: false,
        skip_screenshots: true,
        force: true,
        itc_provider: "{{YOUR_TEAM_ID}}" // <- added!
      )

在 Azure Pipeline 中,我们可以在哪里提及这些 ID? - Sagar

6

要获得 itc_provider,请运行以下命令:

/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/itms/bin/iTMSTransporter -m provider -u 'appleid@xxx.xx' -p 'xxxx-xxxx-xxxx-xxxx' -account_type itunes_connect -v off

其中:

  • appleid@xxx.xx 是您的 Apple ID;
  • xxxx-xxxx-xxxx-xxxx 是应用程序的密码。

如何生成应用程序特定密码:

  • 登录 appleid.apple.com。
  • 在“登录和安全性”部分中,选择“应用程序特定密码”。
  • 选择“生成应用程序特定密码”或选择添加按钮蓝色加号图标,然后按照屏幕上的步骤操作。
  • 将应用程序专用密码输入或粘贴到应用程序的密码字段中。

输入图像描述


如果itms文件夹不存在怎么办?(运行Xcode 14.) - David
您可以从 https://help.apple.com/itc/transporteruserguide/en.lproj/static.html 下载它。 - AlexNikov

1

我使用fastlane deliver上传我的应用程序

对于我来说,解决方案是: 为命令fastlane deliver添加新标签/标志 例如:fastlane deliver --username xxx@xxx.com....

新增加的标签是--itc-provider my_team_id

您可以在此处找到团队ID:页面

因此,最终的命令是: fastlane deliver --verbose --ipa xxx --username xxx --app_identifier xxx --itc_provider team_id

xxx => 对应于您的项目 team_id => 对应于团队ID,您可以在上面的页面上获取


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