Fastlane 失败并显示错误“无法获取内容提供商公共 ID。请使用 -asc_provider 选项指定提供商短名称。”

Har*_*ala 31 app-store ios swift fastlane app-store-connect

我使用 Fastlane 创建了一个 iOS 测试飞行构建,我收到了这个奇怪的错误,不知道为什么,因为它昨天工作正常,现在 Fastlane 配置没有任何更改,它在将构建上传到 Apple 应用商店时出现错误。

错误表述如下

[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:
Run Code Online (Sandbox Code Playgroud)

请参阅下面的日志 在此输入图像描述

Arc*_*ano 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:
      ...
Run Code Online (Sandbox Code Playgroud)


Mah*_*rus 10

请在下面的代码行中添加itc_provider和。apple_id

upload_to_testflight(
    skip_waiting_for_build_processing: true,
    apple_id: "APPLE_ID",
    itc_provider:"ID" #example: W4A0P2BYMN
)
Run Code Online (Sandbox Code Playgroud)

如果您属于多个 App Store Connect 团队,则交付需要提供者短名称才能知道将二进制文件上传到何处。Deliver 将尝试使用所选团队的长名称来检测提供者的短名称。要使用显式值覆盖检测到的值,请使用itc_provider选项。


小智 7

我也有同样的。

github 上的这条评论对我很有帮助。

将 ENV 变量添加到您的部署(或本地计算机,或直接 Fastfile) 使用 DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS 我们可以添加“缺失”的 -asc_provider 变量。

ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"] = "-asc_provider YourShortName" 刚刚部署,它适用于那些迫不及待的人。


小智 7

For me adding the environment variable works perfectly:

ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD: true
Run Code Online (Sandbox Code Playgroud)

For my case, here is an example of Azure DevOps pipelines:

ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD: true
Run Code Online (Sandbox Code Playgroud)

Source Fastlane GitHub issue


小智 6

我就是这样解决的!


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


小智 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'-帐户类型 itunes_connect -v 关闭

其中 appleid@xxx.xx 您的 appleid xxxx-xxxx-xxxx-xxxx - 您的应用程序的密码

如何生成应用程序专用密码

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

在此输入图像描述