【问题标题】:FirebaseProjectNotFoundException: Firebase project id could not be found on this Firebase accountFirebaseProjectNotFoundException:在此 Firebase 帐户上找不到 Firebase 项目 ID
【发布时间】:2022-01-20 00:34:34
【问题描述】:

我找到了this 项目。在我添加到index.html 文件后,下面的 Firebase 配置:

 <!-- The core Firebase JS SDK is always required and must be listed first -->
  <script type="module">
    // Import the functions you need from the SDKs you need
    import { initializeApp } from "https://www.gstatic.com/firebasejs/8.6.1/firebase-app.js";
    import { initializeApp } from "https://www.gstatic.com/firebasejs/8.6.1/firebase-auth.js";
    import { initializeApp } from "https://www.gstatic.com/firebasejs/8.6.1/firebase-firestore.js";
    import { initializeApp } from "https://www.gstatic.com/firebasejs/8.6.1/firebase-storage.js";

    // TODO: Add SDKs for Firebase products that you want to use
    // https://firebase.google.com/docs/web/setup#available-libraries
  
    // Your web app's Firebase configuration
    const firebaseConfig = {
      apiKey: "AIzaSyDoO8efzrDVveeXvqqrc39D3XiqfsyoKeU",
      authDomain: "diary-app-course-c6663.firebaseapp.com",
      projectId: "diary-app-course-c6663",
      storageBucket: "diary-app-course-c6663.appspot.com",
      messagingSenderId: "1031493909898",
      appId: "1:1031493909898:web:3cd71413645447b67c1c73"
    };
  
    // Initialize Firebase
    const app = initializeApp(firebaseConfig);
  </script>

接下来,我在命令行上做了以下步骤:

$ dart pub global activate flutterfire_cli
Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path.
You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.):

  export PATH="$PATH":"$HOME/.pub-cache/bin"

$ vim ~/.bashrc
$ source ~/.bashrc

$ flutterfire configure
$ curl -sL https://firebase.tools | bash

很遗憾,我收到了这个错误:

$ flutterfire configure
i Found 1 Firebase projects. Selecting project diary-app-course.
FirebaseProjectNotFoundException: Firebase project id "diary-app-course" could not be found on this Firebase account.
$ grep -R diary-app-course *
web/index.html:      authDomain: "diary-app-course-c6663.firebaseapp.com",
web/index.html:      projectId: "diary-app-course-c6663",
web/index.html:      storageBucket: "diary-app-course-c6663.appspot.com",

我错过了什么?

【问题讨论】:

    标签: firebase flutter dart google-cloud-firestore flutter-web


    【解决方案1】:

    按照以下步骤操作:

    1. 如果它们的任何默认项目存在于 .firebaserc 文件中,则将其删除。 之前:
        {
          "projects": {
           "default": "diary-app-course"
          }
        }
    

    之后

    
        {
              "projects": {
              }
            }
    
    1. 在 Firebase CLI 中运行此命令:
    firebase logout
    
    1. 再次登录:
    firebase login
    
    1. 再次在 Firebase CLI 中运行此命令
    flutterfire configure
    

    希望这行得通。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-22
      • 2019-03-24
      • 2019-01-28
      • 2019-01-15
      • 1970-01-01
      • 2020-09-01
      • 2021-11-26
      • 1970-01-01
      相关资源
      最近更新 更多