我正在使用the steps来托管我的flutter helloworld应用程序。所有的步骤都很顺利,但是我看到的不是我的应用程序,而是这个屏幕。
会有什么问题呢?
我的命令:
polinach-macbookpro3:my_app1 polinach$ flutter build web
💪 Building with sound null safety 💪
Compiling lib/main.dart for the Web... 391ms
polinach-macbookpro3:my_app1 polinach$ firebase init hosting
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
/Users/polinach/_/__/my_app1
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? Please select an option: Create a new project
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.
? Please specify a unique project id (warning: cannot be modified afterward) [6-30 characters]:
polina-test2
? What would you like to call your project? (defaults to your project ID)
✔ Creating Google Cloud Platform project
✔ Adding Firebase resources to Google Cloud Platform project
🎉🎉🎉 Your Firebase project is ready! 🎉🎉🎉
Project information:
- Project ID: polina-test2
- Project Name: polina-test2
Firebase console is available at
https://console.firebase.google.com/project/polina-test2/overview
i Using project polina-test2 (polina-test2)
=== Hosting Setup
Your public directory is the folder (relative to your project directory) that
will contain Hosting assets to be uploaded with firebase deploy. If you
have a build process for your assets, use your build's output directory.
? What do you want to use as your public directory? build/web
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? Set up automatic builds and deploys with GitHub? No
? File build/web/index.html already exists. Overwrite? Yes
✔ Wrote build/web/index.html
i Writing configuration info to firebase.json...
i Writing project information to .firebaserc...
✔ Firebase initialization complete!
polinach-macbookpro3:my_app1 polinach$ firebase deploy --only hosting
=== Deploying to 'polina-test2'...
i deploying hosting
i hosting[polina-test2]: beginning deploy...
i hosting[polina-test2]: found 21 files in build/web
✔ hosting[polina-test2]: file upload complete
i hosting[polina-test2]: finalizing version...
✔ hosting[polina-test2]: version finalized
i hosting[polina-test2]: releasing new version...
✔ hosting[polina-test2]: release complete
✔ Deploy complete!
Project Console: https://console.firebase.google.com/project/polina-test2/overview
Hosting URL: https://polina-test2.web.app
1条答案
按热度按时间qybjjes11#
查看输出的以下部分:
您告诉它覆盖现有的build/web/index.html。这就是您在浏览器中看到的内容-Firebase CLI提供的HTML。
在运行
firebase deploy
之前,您需要确保您的“public目录”(您将其设置为“build/web”)包含您想要部署的内容,并使用index.html作为默认服务。