I am trying to set up Firebase in my Flutter project using flutterfire configure
after firebase login
to get a firebase_options.dart
file to be able to connect to the Firebase environment.
This is what the output looks like when running the command and answering the questions:
i Found 5 Firebase projects.
✔ Select a Firebase project to configure your Flutter application with · bilgi-quiz (Bilgi)
✔ Which platforms should your configuration support (use arrow keys & space to select)? · android, ios, macos, web, windows
✔ Which Android application id (or package name) do you want to use for this configuration, e.g. 'com.example.app'? · com.bilgi.app
i Firebase android app com.bilgi.app registered.
i Firebase ios app com.example.bilgi registered.
i Firebase macos app com.example.bilgi registered.
i Firebase web app bilgi (web) registered.
type 'Null' is not a subtype of type 'String' in type cast
My Firebase Package has version: 13.31.1
My Flutterfire Package has version: 1.0.1
I tried to solve the issue by downgrading Flutterfire to version 1.0.0 and 2.6. It did not change anything except for getting a more detailed description of what is going wrong:
type 'Null' is not a subtype of type 'String' in type cast
#0 new FirebaseOptions.fromMap (package:flutterfire_cli/src/firebase/firebase_options.dart:54:32)
#1 FirebaseWebOptions.forFlutterApp (package:flutterfire_cli/src/firebase/firebase_web_options.dart:57:28)
<asynchronous suspension>
#2 ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:433:20)
<asynchronous suspension>
#3 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#4 main (file:///Users/marcelhofmann/.pub-cache/hosted/pub.dev/flutterfire_cli-0.2.7/bin/flutterfire.dart:57:5)
<asynchronous suspension>
I also reinstalled firebase
and flutterfire
, recreated the Flutter project, and ran flutterfire configure
with sudo
but I am not able to fix it still.
If I am not mistaken, type 'Null' is not a subtype of type 'String' in type cast
should mean something like a Null
value is trying to be assigned to a String
, so maybe some information are missing. Maybe there is a permission issue?
When I do flutter clean
and then flutter pub get
, after download dependencies, this comes up:
Cannot open file, path = 'pubspec.lock' (OS Error: Permission denied, errno = 13)
I have to run it with sudo
what supports my permission problem assumption.
Upgraded flutterfire to v1.1.0 and now all is working as expected.