To avoid errors, you can use the flutter fire to setup firebase for project. The instructions on how to use flutterfire is given here