Firebase 应用程序分发(fastlane 插件):无法从刷新令牌生成凭据

问题描述 投票:0回答:2

问题是我无法在 Firebase 中授权(App Distribution 无法从指定的刷新令牌生成凭据)。我收到一个错误:

App Distribution could not generate credentials from the refresh token specified.
Refresh token used: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXfE-VQ" (redacted)
Authorization failed.  Server message:
{
  "error": "invalid_grant",
  "error_description": "Bad Request"
}
Response status: 400

+------+------------------------------------+-------------+
|                    fastlane summary                     |
+------+------------------------------------+-------------+
| Step | Action                             | Time (in s) |
+------+------------------------------------+-------------+
| 1    | default_platform                   | 0           |
| 2    | :app:assembleSkRelease             | 5           |
| 3    | Switch to android defineGroup lane | 0           |
| 4    | Switch to android distributeFB     | 0           |
|      | lane                               |             |
| 💥   | firebase_app_distribution          | 0           |
+------+------------------------------------+-------------+

我多次尝试通过firebase插件生成新的刷新令牌:

bundle exec fastlane run firebase_app_distribution_login
,但没有效果。我检查了我是否在我的环境中正确设置了新的
$FIREBASE_TOKEN

插件信息:

+-------------------------------------+---------+-------------------------------------+
|                                    Used plugins                                     |
+-------------------------------------+---------+-------------------------------------+
| Plugin                              | Version | Action                              |
+-------------------------------------+---------+-------------------------------------+
| fastlane-plugin-firebase_app_distr  | 0.3.3   | firebase_app_distribution,          |
| ibution                             |         | firebase_app_distribution_add_test  |
|                                     |         | ers,                                |
|                                     |         | firebase_app_distribution_get_late  |
|                                     |         | st_release,                         |
|                                     |         | firebase_app_distribution_get_udid  |
|                                     |         | s,                                  |
|                                     |         | firebase_app_distribution_login,    |
|                                     |         | firebase_app_distribution_remove_t  |
|                                     |         | esters                              |
+-------------------------------------+---------+-------------------------------------+

我该如何修复它?

android firebase fastlane firebase-app-distribution
2个回答
3
投票

检查您设置的 $FIREBASE_TOKEN 值是否是您输入网站代码后在终端中打印的值,而不是最后一个值。


0
投票

我遇到了同样的问题并解决了以下步骤。

原因

此问题源于您的 FIREBASE_CLI_TOKEN 已过期。

如何解决。

  1. 执行以下命令来检索刷新的 CLI 令牌
$ firebase login:ci
Waiting for authentication...

✔  Success! Use this token to login on a CI server:

{TOKEN can be shown here}

Example: firebase deploy --token "$FIREBASE_TOKEN"

  1. 设置令牌 将上一步获得的令牌设置为 CI 服务器中的环境变量。如果您还没有创建它,请将其创建到您的环境变量中。

按照上述步骤,我就可以构建和部署了。

© www.soinside.com 2019 - 2024. All rights reserved.