user17784209
user17784209

Reputation:

Error: "FirebaseOptions cannot be null when creating the default app."

when I want start my Project I get this error FirebaseOptions cannot be null when creating the default app.

I fonud another entry with this problem.

One answer says, that I have to install Flutterfire CLI. So I execute this command in the Console: dart pub global activate flutterfire_cli but get this warning: Pub installs executables into C:\Users\nuc\AppData\Local\Pub\Cache\bin, which is not on your path. You can fix that by adding that directory to your system's "Path" environment variable. In the next line it says, that the flutterfire was activated. So I continued the setup with this command: flutterfire configure and get this error: flutterfire : Die Benennung "flutterfire" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang. (Its in german). so I don´t know how to fix that and how I can initialce the Firebase.

I would love fast and good answers, because I want to finish this project this week.

Upvotes: 0

Views: 3657

Answers (2)

Snehal Singh
Snehal Singh

Reputation: 116

For resolving this issue you should have FlutterFire CLI installed in your system. And then from your Flutter project directory, run the following command to start the app configuration workflow:

flutterfire configure

For more information, you can go through this guide: https://firebase.google.com/docs/flutter/setup?platform=ios

Upvotes: 0

Gudie
Gudie

Reputation: 19

pass the options argument in the Firebase.intializeApp() method.

eg

options: FirebaseOptions(
apiKey: 'apiKey', 
appId: 'appId', 
messagingSenderId: 'messagingSenderId', 
projectId: 'projectId');

Upvotes: 1

Related Questions