简体   繁体   English

如何在Firebase中托管flutter应用?

[英]How to host flutter application in Firebase?

What is the freshest instruction on how to host a flutter web app?关于如何托管 flutter web 应用程序的最新说明是什么? I am following https://developer.school/tutorials/hosting-a-flutter-web-project-on-firebase-hosting on Windows, and the step firebase init here fails for me.我在 Windows 上关注https://developer.school/tutorials/hosting-a-flutter-web-project-on-firebase-hosting ,这里的步骤 firebase init 对我来说失败了。

Here is the content of firebase-debug.log:以下是 firebase-debug.log 的内容:

You're about to initialize a Firebase project in this directory:

  C:\Coding Repository\230102 flutter hello world\flutter_hello_world

Before we get started, keep in mind:

  * You are currently outside your home directory

[info] 
=== Project Setup
[info] 
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add, 
[info] but for now we'll just set up a default project.
[info] 
[info] i  If you want to create a project in a Google Cloud organization or folder, please use "firebase projects:create" instead, and return to this command when you've created the project. 
[debug] [2023-01-03T04:11:48.673Z] >>> [apiv2][query] POST https://cloudresourcemanager.googleapis.com/v1/projects [none]
[debug] [2023-01-03T04:11:48.674Z] >>> [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects {"projectId":"flutter_hello_world_deployment_by_mish","name":"flutter_hello_world"}
[debug] [2023-01-03T04:11:48.832Z] <<< [apiv2][status] POST https://cloudresourcemanager.googleapis.com/v1/projects 400
[debug] [2023-01-03T04:11:48.832Z] <<< [apiv2][body] POST https://cloudresourcemanager.googleapis.com/v1/projects {"error":{"code":400,"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT","details":[{"@type":"type.googleapis.com/google.rpc.BadRequest","fieldViolations":[{"field":"project_id","description":"project_id must be at most 30 characters long"},{"field":"project_id","description":"project_id contains invalid characters"},{"field":"display_name","description":"project display name contains invalid characters"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"url":"https://cloud.google.com/resource-manager/reference/rest/v1/projects"}]}]}}
[debug] [2023-01-03T04:11:48.881Z] FirebaseError: HTTP Error: 400, Request contains an invalid argument.
    at responseToError (C:\Users\mishc\AppData\Roaming\npm\node_modules\firebase-tools\lib\responseToError.js:49:12)
    at RetryOperation._fn (C:\Users\mishc\AppData\Roaming\npm\node_modules\firebase-tools\lib\apiv2.js:288:77)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[error] 
[error] Error: Failed to create project. See firebase-debug.log for more info.

The error message says:错误消息说:

project_id must be at most 30 characters long project_id 的长度不得超过 30 个字符

So it sounds like you entered a project ID that was longer than that.所以听起来你输入的项目 ID 比那个长。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM