【问题标题】:Firebase throwing "the server responded with status 400"Firebase 抛出“服务器以状态 400 响应”
【发布时间】:2021-01-16 22:10:03
【问题描述】:

我正在为我在 react native 中完成的应用程序实施 CICD,但现在我遇到了一种情况,即 firebase 不允许我上传 ipa 和 apk“服务器响应状态为 400强>”。我已经使用我的帐户先上传到那里,现在我正在使用另一个帐户,它工作得很好。现在不让我上传了。

这是我在终端窗口中得到的。

[13:28:30]: ???? Authenticated successfully.
[13:28:33]: ⌛ Uploading the APK.
[13:28:47]: ✅ Uploaded the APK.
[13:28:48]: the server responded with status 400
+------+---------------------------+-------------+
|                fastlane summary                |
+------+---------------------------+-------------+
| Step | Action                    | Time (in s) |
+------+---------------------------+-------------+
| 1    | clean assembleRelease     | 315         |
| ????   | firebase_app_distribution | 18          |
+------+---------------------------+-------------+

【问题讨论】:

  • 嘿,你解决了吗?

标签: firebase build-automation fastlane


【解决方案1】:

400 表示“错误请求”。而且,老实说,这缺乏来自 Fastlane 的详细信息,因为它只是(追溯地)表明所提供的配置不完整或不正确。

以下是此处发生的示例:原因是从 Firebase 项目复制的应用 ID 错误(我尝试的是编码的应用 ID,而不是应用 ID)。

platform :ios do
  desc 'Me App'
  lane :beta do
      build_ios_app(
        export_method: 'ad-hoc',
        export_options: {
        provisioningProfiles: {
            'com.example.meapp' => 'Me App'
          }
        }
      )
      firebase_app_distribution(
          app: 'bad_id',   # The 400 was from a bad ID here.
          testers: 'eric.platon@gmail.com',
          release_notes: release_notes,
      )
  end
end

截至撰写本文时,我在 Fastlane 的错误跟踪中找到了线索。一些Ruby code 正在抛出错误。

def self.run(params)
  params.values      # <= printing out the `params` showed all pieces that could lead to a 400 Bad Request
  # ...
  app = fad_api_client.get_app(app_id, app_view)

查看它是如何破坏的有助于理解罪魁祸首是这里的应用 ID。希望这在 OP 情况下也足够了。

【讨论】:

    【解决方案2】:

    这可能有两个原因:firebase 令牌无效,或者 firebase 分发服务帐户没有将构建发布到 Firebase 的权限或角色。

    因此,尝试生成另一个令牌,并检查 Google Cloud 是否有具有 Firebase 应用分发角色的服务帐户。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-11
      • 2021-01-28
      • 1970-01-01
      • 2016-07-08
      • 2020-05-29
      • 1970-01-01
      • 2021-04-12
      • 2018-12-04
      相关资源
      最近更新 更多