在 Cloud Build 中使用 Firebase CLI 时出错

Error when using Firebase CLI in Cloud Build

当我 运行“cloud-build-local --dry运行=false”时出现以下错误。在我的本地机器上:

Firebase Management API has not been used in project 32555940559 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firebase.googleapis.com/overview?project=32555940559 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

列出的项目编号不是我的任何项目的编号。我在谷歌上搜索了这个数字,似乎更多的用户在其中遇到了这个项目编号的错误。我已经检查了以下内容:

如有任何帮助,我们将不胜感激!

cloud-build-local是用来build a image locally的命令。

Cloud Build 本地环境以及所有其他 GCP 本地环境都在您的 Google 云环境之外,因此您在此处看到的 project-id 引用了 gcloud 项目编号。这意味着 gcloud 将无法使用您各自项目的登录凭据,并且不会自动使用 Cloud Build gcloud 命令所需的 Cloud Build 服务帐户进行身份验证。

在这种情况下,您需要使用 gcloud auth application-default login. This will provide new user credentials for use with Application Default Credentials 来授权您使用本地 Cloud Build 开发所需的服务帐户。