[SOLVED] No Firebase App ‘[DEFAULT]’ has been created – call Firebase.initializeApp() in Flutter


This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under
CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

Issue

I am using the web (Chrome) to run my application. But, I get an error. Here is the error:

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following FirebaseException was thrown building App(dirty, dependencies:
[UncontrolledProviderScope], state: _AppState#4cc6e):
[core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()

The relevant error-causing widget was:
  App App:file:///Users/name/development/projects/flutter/hello_world/lib/src/hello_world.dart:46:21

When the exception was thrown, this was the stack:
#1      <anonymous closure> (http://localhost:7357/packages/riverpod/src/stack_trace.dart:7:11)
#2      <anonymous closure> (http://localhost:7357/packages/riverpod/src/framework/provider_base.dart:332:25)
#3      map (http://localhost:7357/packages/riverpod/src/framework/provider_base.dart:1158:17)
#4      get requireState (http://localhost:7357/packages/riverpod/src/framework/provider_base.dart:331:17)
#5      readSelf (http://localhost:7357/packages/riverpod/src/framework/provider_base.dart:826:12)
#6      read (http://localhost:7357/packages/riverpod/src/framework/provider_base.dart:174:29)
#7      watch (http://localhost:7357/packages/flutter_riverpod/src/consumer.dart:505:20)
#8      build (http://localhost:7357/packages/bizzee/src/app.dart:59:26)
#9      build (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4919:27)
#10     build (http://localhost:7357/packages/flutter_riverpod/src/consumer.dart:485:20)
#11     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4806:15)
#12     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#13     rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#14     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#15     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#16     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#17     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#18     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#19     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#20     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#21     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#22     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#23     rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#24     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#25     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#26     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#27     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#28     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#29     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#30     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#31     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#32     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#33     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#34     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#35     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#36     rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#37     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#38     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#39     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#40     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#41     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6350:36)
#42     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6362:32)
#43     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#44     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#45     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#46     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#47     rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#48     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#49     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#50     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#51     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#52     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#53     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#54     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#55     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#56     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#57     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#58     rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#59     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#60     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#61     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#62     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#63     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#64     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#65     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#66     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#67     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#68     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#69     rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#70     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#71     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#72     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#73     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#74     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#75     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#76     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#77     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#78     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#79     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#80     rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#81     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#82     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#83     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#84     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#85     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#86     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#87     rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#88     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#89     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#90     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#91     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#92     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#93     performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#94     rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#95     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#96     [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#97     mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#98     inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#99     updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#100    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#101    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#102    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#103    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#104    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#105    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#106    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#107    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#108    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#109    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#110    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#111    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#112    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#113    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#114    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#115    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#116    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#117    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#118    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#119    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#120    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#121    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#122    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#123    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#124    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#125    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#126    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#127    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#128    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#129    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#130    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#131    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#132    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#133    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#134    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#135    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#136    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#137    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#138    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#139    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#140    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#141    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#142    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#143    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#144    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#145    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#146    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#147    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#148    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#149    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#150    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#151    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#152    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#153    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#154    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#155    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#156    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#157    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#158    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#159    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#160    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#161    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#162    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#163    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#164    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#165    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#166    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#167    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#168    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#169    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#170    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#171    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#172    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#173    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#174    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#175    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#176    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#177    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#178    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#179    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#180    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#181    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#182    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#183    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#184    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#185    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#186    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#187    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#188    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#189    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#190    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#191    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#192    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#193    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#194    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#195    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#196    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#197    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#198    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#199    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#200    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#201    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#202    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#203    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#204    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#205    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#206    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#207    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#208    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#209    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#210    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#211    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#212    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#213    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#214    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#215    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#216    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#217    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#218    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6350:36)
#219    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6362:32)
#220    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#221    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#222    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#223    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#224    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#225    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#226    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#227    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#228    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#229    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#230    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#231    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#232    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#233    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#234    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#235    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#236    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#237    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#238    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#239    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
#240    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#241    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#242    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:6215:14)
#243    inflateWidget (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3817:15)
#244    updateChild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:3551:18)
#245    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4832:16)
#246    performRebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4977:11)
#247    rebuild (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4529:5)
#248    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4787:5)
#249    [_firstBuild] (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4968:11)
#250    mount (http://localhost:7357/packages/flutter/src/widgets/framework.dart:4781:5)
...... (too long)

I initialized Firebase in the main() method after WidgetsFlutterBinding.ensureInitialized() like this:

Future<void> main() async {
  await runZonedGuarded(
    () async {
      WidgetsFlutterBinding.ensureInitialized();
      await Firebase.initializeApp();
      GoRouter.setUrlPathStrategy(UrlPathStrategy.path);
      runApp(const ProviderScope(child: HelloWorld()));
      ......
    },
    (Object error, StackTrace stack) {
        debugPrint(error.toString());
        debugPrint(stack.toString());
    },
  );
}

I never get this error when I run my app with Android Emulator.

How can I fix this error? Appreciate if someone can advise. Thank you in advance!

Solution

If you are using the latest version of Firebase. Please follow the web installation steps carefully. I am using Firebase too in my web app and I faced the same issue in the beginning. After installation remember to run your project again from the beginning.

https://firebase.google.com/docs/flutter/setup?platform=web

Answered By – Md. Kamrul Amin

people found this article helpful. What about you?