fluttercrashlyticsflutter-add-to-app

No Firebase App '[DEFAULT]': for 'Add to App' flutter app with firebase_crashlytics


TLDR;

How can we configure firebase crashlytics with flutterfire for Add to App I've seen other stackoverflow questions and tried those options already

Longer version:

    void main() {
      runZonedGuarded(() async {
        // Initialize Flutter bindings; must come first!
        WidgetsFlutterBinding.ensureInitialized();
        await Firebase.initializeApp(
        );
        ... 

Call stack looks like this

[VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()
#0      MethodChannelFirebase.app (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:193:5)
#1      Firebase.app (package:firebase_core/src/firebase.dart:53:41)
#2      FirebaseCrashlytics.instance (package:firebase_crashlytics/src/firebase_crashlytics.dart:33:55)
#3      main.<anonymous closure> (package:package/main.dart:58:25)
#4      _rootRunBinary (dart:async/zone.dart:1450:47)
#5      _CustomZone.runBinary (dart:async/zone.dart:1342:19)
#6      runZonedGuarded.<anonymous closure> (dart:async/zone.dart:1832:18)
#7      _Zone._processUncaughtError (dart:async/zone.dart:1109:14)
#8      _CustomZone.handleUncaughtError (dart:async/zone.dart:1312:5)
#9      Future._propagateToListeners (dart:async/future_impl.dart:680:16)
#10     Future._completeError (dart:async/future_impl.dart:574:5)
#11     _completeOnAsync<…>

All was well with firebase 1.5.0 but I had to upgrade for crashlytics

Change in packages enter image description here

So far what I have tried

  1. Generate the file firebase_options.dart file from flutterconfigure and refer to it from the child with following syntax
 await Firebase.initializeApp(
      options: DefaultFirebaseOptions.currentPlatform,
    );
  1. Also tried to give name parameter but that didn't help either.

Question is where is the [DEFAULT] project being referenced and how can I remove/edit it?


Solution

  • This issue should be fixed with the latest version of firebase_core and any additional flutterfire packages you might be using in your project.