I have coded a chat app which uses firebase. When I first ran it as an android app and a web app, it worked for a month. Recently, however, not only does the android app take forever to load when firebase is initialised, but also when I try to sign in from the web app, it gives an error:
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ [firebase_functions/internal] internal
│
│
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ #0 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49 throw_
│ #1 packages/cloud_functions_web/https_callable_web.dart 46:7 call
│ #2 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 60:31 <fn>
│ #3 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1690:54 runBinary
│ #4 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 174:22 handleError
│ #5 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 778:46 handleError
│ #6 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 799:13 _propagateToListeners
│ #7 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 609:5 [_completeError]
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ ⛔ Sign in error,
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I do not understand what is wrong as the error message is not specific enough. I have checked my firebase configurations on the website but nothing seems off. Here is my firebase authentication code:
final creds =
await firebase.FirebaseAuth.instance.signInWithEmailAndPassword(
email: _emailController.text,
password: _passwordController.text,
);
Can someone tell me how to fix this? If you would like to clarify something please let me know.
1 Answer 1
It seems related to this flutterfire issue/2558#issuecomment-824781256
Please ensure you're using the following step in your flutter project web as per the documentation
- Install the required command line tools
- Install firebase cli from https://firebase.google.com/docs/cli#setup_update_cli
- Login firebase using
firebase login - Install flutterfire cli using
dart pub global activate flutterfire_cli
- Configure your apps to use Firebase
flutterfire configure - Initialize Firebase in your app
- From your Flutter project directory, run the following command to install the core plugin:
flutter pub add firebase_core - Configure flutter project
flutterfire configure - In your
lib/main.dartfile, import the Firebase core plugin and the configuration file you generated earlier:import 'package:firebase_core/firebase_core.dart'; import 'firebase_options.dart'; - Also in your
lib/main.dartfile, initialize Firebase using theDefaultFirebaseOptionsobject exported by the configuration file:await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); - Rebuild your Flutter application:
flutter run
- From your Flutter project directory, run the following command to install the core plugin:
- Add Firebase plugins
- From your Flutter project directory, run the following command:
then configure itflutter pub add cloud_functions
and once complete, rebuild your Flutter project:flutterfire configureflutter run
- From your Flutter project directory, run the following command:
Sometimes my old flutter projects with firebase just stop working suddenly, upgrading it to the latest flutter stable and update the packages to the latest most of the time will fix it.