title: FirebaseOptions cannot be null when creating the default app
body: <p>I am trying to try a sample project in Flutter integration email and google based login, and planning to use firebase initialisation for doing it while I have followed all the steps as mentioned in tutorials I am getting this error as soon as firebase is attempted to be initialised.</p>
  <pre><code>&quot;FirebaseOptions cannot be null when creating the default app.&quot;
      at Object.throw_ [as throw] (http://localhost:7357/dart_sdk.js:5063:11)
      at Object.assertFailed (http://localhost:7357/dart_sdk.js:4988:15)
  at firebase_core_web.FirebaseCoreWeb.new.initializeApp (http://localhost:7357/packages/firebase_core_web/firebase_core_web.dart.lib.js:252:42)
      at initializeApp.next (&lt;anonymous&gt;)
      at http://localhost:7357/dart_sdk.js:40192:33
      at _RootZone.runUnary (http://localhost:7357/dart_sdk.js:40062:59)
      at _FutureListener.thenAwait.handleValue (http://localhost:7357/dart_sdk.js:34983:29)
      at handleValueCallback (http://localhost:7357/dart_sdk.js:35551:49)
      at Function._propagateToListeners (http://localhost:7357/dart_sdk.js:35589:17)
      at _Future.new.[_completeWithValue] (http://localhost:7357/dart_sdk.js:35437:23)
      at async._AsyncCallbackEntry.new.callback (http://localhost:7357/dart_sdk.js:35458:35)
      at Object._microtaskLoop (http://localhost:7357/dart_sdk.js:40330:13)
      at _startMicrotaskLoop (http://localhost:7357/dart_sdk.js:40336:13)
      at http://localhost:7357/dart_sdk.js:35811:9
  </code></pre>
  <p>Here is my index.html</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;!--
      If you are serving your web app in a path other than the root, change the
      href value below to reflect the base path you are serving from.
  
      The path provided below has to start and end with a slash &quot;/&quot; in order for
      it to work correctly.
  
      For more details:
      * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
  
      This is a placeholder for base href that will be replaced by the value of
      the `--base-href` argument provided to `flutter build`.
    --&gt;
    &lt;base href=&quot;$FLUTTER_BASE_HREF&quot;&gt;
  
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta content=&quot;IE=Edge&quot; http-equiv=&quot;X-UA-Compatible&quot;&gt;
    &lt;meta name=&quot;description&quot; content=&quot;A new Flutter project.&quot;&gt;
    &lt;meta name=&quot;google-signin-client_id&quot; content=&quot;619218114547-xxxx.apps.googleusercontent.com&quot;&gt;
    &lt;!-- iOS meta tags &amp; icons --&gt;
    &lt;meta name=&quot;apple-mobile-web-app-capable&quot; content=&quot;yes&quot;&gt;
    &lt;meta name=&quot;apple-mobile-web-app-status-bar-style&quot; content=&quot;black&quot;&gt;
    &lt;meta name=&quot;apple-mobile-web-app-title&quot; content=&quot;signin_example&quot;&gt;
    &lt;link rel=&quot;apple-touch-icon&quot; href=&quot;icons/Icon-192.png&quot;&gt;
    
    &lt;!-- Favicon --&gt;
    &lt;link rel=&quot;icon&quot; type=&quot;image/png&quot; href=&quot;favicon.png&quot;/&gt;
  
    &lt;title&gt;signin_example&lt;/title&gt;
    &lt;link rel=&quot;manifest&quot; href=&quot;manifest.json&quot;&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;!-- This script installs service_worker.js to provide PWA functionality to
         application. For more information, see:
         https://developers.google.com/web/fundamentals/primers/service-workers --&gt;
    
    
    &lt;script&gt;
      var serviceWorkerVersion = null;
      var scriptLoaded = false;
      function loadMainDartJs() {
        if (scriptLoaded) {
          return;
        }
        scriptLoaded = true;
        var scriptTag = document.createElement('script');
        scriptTag.src = 'main.dart.js';
        scriptTag.type = 'application/javascript';
        document.body.append(scriptTag);
      }
  
      if ('serviceWorker' in navigator) {
        // Service workers are supported. Use them.
        window.addEventListener('load', function () {
          // Wait for registration to finish before dropping the &lt;script&gt; tag.
          // Otherwise, the browser will load the script multiple times,
          // potentially different versions.
          var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
          navigator.serviceWorker.register(serviceWorkerUrl)
            .then((reg) =&gt; {
              function waitForActivation(serviceWorker) {
                serviceWorker.addEventListener('statechange', () =&gt; {
                  if (serviceWorker.state == 'activated') {
                    console.log('Installed new service worker.');
                    loadMainDartJs();
                  }
                });
              }
              if (!reg.active &amp;&amp; (reg.installing || reg.waiting)) {
                // No active web worker and we have installed or are installing
                // one for the first time. Simply wait for it to activate.
                waitForActivation(reg.installing || reg.waiting);
              } else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
                // When the app updates the serviceWorkerVersion changes, so we
                // need to ask the service worker to update.
                console.log('New service worker available.');
                reg.update();
                waitForActivation(reg.installing);
              } else {
                // Existing service worker is still good.
                console.log('Loading app from service worker.');
                loadMainDartJs();
              }
            });
  
          // If service worker doesn't succeed in a reasonable amount of time,
          // fallback to plaint &lt;script&gt; tag.
          setTimeout(() =&gt; {
            if (!scriptLoaded) {
              console.warn(
                'Failed to load app from service worker. Falling back to plain &lt;script&gt; tag.',
              );
              loadMainDartJs();
            }
          }, 4000);
        });
      } else {
        // Service workers not supported. Just drop the &lt;script&gt; tag.
        loadMainDartJs();
      }
    &lt;/script&gt;
    &lt;script type=&quot;module&quot;&gt;
      // Import the functions you need from the SDKs you need
      import { initializeApp } from &quot;https://www.gstatic.com/firebasejs/9.6.0/firebase-app.js&quot;;
      import { getAnalytics } from &quot;https://www.gstatic.com/firebasejs/9.6.0/firebase-analytics.js&quot;;
      // 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
      // For Firebase JS SDK v7.20.0 and later, measurementId is optional
      const firebaseConfig = {
        apiKey: &quot;xxx&quot;,
        authDomain: &quot;xxx&quot;,
        projectId: &quot;xx&quot;,
        storageBucket: &quot;exxx&quot;,
        messagingSenderId: &quot;xxx&quot;,
        appId: &quot;xxx&quot;,
        measurementId: &quot;xxx&quot;
      };
  
      // Initialize Firebase
      const app = initializeApp(firebaseConfig);
      const analytics = getAnalytics(app);
    &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Part of code from main.dart file where firebase initialisation is happening</p>
  <pre><code>void main() async {
    WidgetsFlutterBinding.ensureInitialized();
    await Firebase.initializeApp();
    runApp(SignUpApp());
  }
  </code></pre>
  <p>Pubsec.yaml file of the project</p>
  <pre><code>name: signin_example
  description: A new Flutter project.
  
  # The following line prevents the package from being accidentally published to
  # pub.dev using `flutter pub publish`. This is preferred for private packages.
  publish_to: 'none' # Remove this line if you wish to publish to pub.dev
  
  https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
  version: 1.0.0+1
  
  environment:
    sdk: &quot;&gt;=2.15.0-268.18.beta &lt;3.0.0&quot;
  
  dependencies:
    flutter:
      sdk: flutter
  
  
    # The following adds the Cupertino Icons font to your application.
    # Use with the CupertinoIcons class for iOS style icons.
    cupertino_icons: ^1.0.2
    firebase_auth: ^3.3.0
    firebase_core: ^1.10.2
    google_sign_in: ^5.2.1
    shared_preferences: ^2.0.9
  
  dev_dependencies:
    flutter_test:
      sdk: flutter
  
    flutter_lints: ^1.0.0
  
  # The following section is specific to Flutter.
  flutter:
  
    assets:
      - assets/images/
  
    uses-material-design: true
  </code></pre>
  <p>Can anyone help me understand what is the issue here?</p>