Skip to content

🐛 [firebase_crashlytics] Getting "Unhandled Exception: [core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()" #6964

@ParasGarg7

Description

@ParasGarg7

Bug report

I tried using the official example for firebase_crashlytics where the following commands were inside the runZonedGuarded

  • WidgetsFlutterBinding.ensureInitialized()
  • await Firebase.initializeApp()

But every time I am getting the same error when running the app in iOS Simulator or device

Click To Expand
Launching lib/main.dart on iPhone 11 in debug mode...
Warning: Missing build name (CFBundleShortVersionString).
Warning: Missing build number (CFBundleVersion).
Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.
Running Xcode build...                                                  
 └─Compiling, linking and signing...                        16.0s
Xcode build done.                                           128.7s
8.6.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
[Firebase/Crashlytics] Version 8.6.0
8.6.0 - [Firebase/Analytics][I-ACS023007] Analytics v.8.6.0 started
8.6.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
[VERBOSE-2:ui_dart_state.cc(199)] 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:123:5)
#1      Firebase.app (package:firebase_core/src/firebase.dart:55:41)
#2      FirebaseCrashlytics.instance (package:firebase_crashlytics/src/firebase_crashlytics.dart:33:55)
#3      main (package:firebase_crashlytics_example/main.dart:28:26)
#4      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:142:25)
#5      _rootRun (dart:async/zone.dart:1354:13)
#6      _CustomZone.run (dart:async/zone.dart:1258:19)
#7      _runZoned (dart:async/zone.dart:1789:10)
#8      runZonedGuarded (dart:async/zone.dart:1777:12)
#9      _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:138:5)
#10     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:283:19)
#11     _RawReceivePortImpl._<…>
Syncing files to device iPhone 11...                               382ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

Running with unsound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

An Observatory debugger and profiler on iPhone 11 is available at: http://127.0.0.1:60454/lOMoTLOIkEg=/
The Flutter DevTools debugger and profiler on iPhone 11 is available at: http://127.0.0.1:9105?uri=http%3A%2F%2F127.0.0.1%3A60454%2FlOMoTLOIkEg%3D%2F
8.6.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
8.6.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled
8.6.0 - [Firebase/Analytics][I-ACS023220] Analytics screen reporting is enabled. Call +[FIRAnalytics logEventWithName:FIREventScreenView parameters:] to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist

which leadds to app being stuck on a White Screen, and not able to proceed further.

Steps to reproduce

Steps to reproduce the behavior:

  1. Clone the official repo of FlutterFire.
  2. Go to the folder "packages/firebase_crashlytics/firebase_crashlytics/example".
  3. Execute flutter pub get.
  4. Open an iOS Simulator or connect a iOS Device.
  5. Execute flutter run.

Expected behavior

The app should have run normally without any issues, and should see the main screen.

Sample project

Use the example project of the FlutterFire itself. link


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.2.2 20D80 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] Connected device (2 available)

• No issues found!

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.13.1
Flutter SDK 2.2.1
firebase_crashlytics_example 0.0.0

dependencies:
- firebase_analytics 8.3.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core flutter meta]
- firebase_core 1.6.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 2.2.1 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]

dev dependencies:
- drive 0.1.0 [test_api flutter_test flutter_driver stack_trace universal_platform flutter]
- flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver archive async boolean_selector characters charcode clock collection crypto matcher platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math]
- test 1.16.8 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pedantic pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core]

dependency overrides:
- firebase_core 1.6.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface]
- firebase_core_web 1.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics 2.2.1 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_crashlytics_platform_interface 3.1.2 [collection firebase_core flutter meta plugin_platform_interface]

transitive dependencies:
- _fe_analyzer_shared 22.0.0 [meta]
- analyzer 1.7.1 [_fe_analyzer_shared cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml pedantic]
- archive 3.1.2 [crypto path]
- args 2.2.0
- async 2.6.1 [meta collection]
- boolean_selector 2.1.0 [source_span string_scanner]
- characters 1.1.0
- charcode 1.2.0
- cli_util 0.3.3 [meta path]
- clock 1.1.0
- collection 1.15.0
- convert 3.0.1 [typed_data]
- coverage 1.0.3 [args logging package_config path source_maps stack_trace vm_service]
- crypto 3.0.1 [collection typed_data]
- fake_async 1.2.0 [clock collection]
- file 6.1.0 [meta path]
- firebase 9.0.1 [http http_parser js]
- firebase_analytics_platform_interface 2.0.1 [flutter meta]
- firebase_analytics_web 0.3.0+1 [firebase firebase_analytics_platform_interface flutter flutter_web_plugins meta]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform]
- glob 2.0.1 [async collection file path pedantic string_scanner]
- http 0.13.3 [async http_parser meta path pedantic]
- http_multi_server 3.0.1 [async]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- io 1.0.3 [meta path string_scanner]
- js 0.6.3
- logging 1.0.1
- matcher 0.12.10 [stack_trace]
- meta 1.3.0
- mime 1.0.0
- node_preamble 2.0.1
- package_config 2.0.0 [path]
- path 1.8.0
- pedantic 1.11.1
- platform 3.0.0
- plugin_platform_interface 2.0.1 [meta]
- pool 1.5.0 [async stack_trace]
- process 4.2.1 [file path platform]
- pub_semver 2.0.0 [collection]
- shelf 1.2.0 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.0 [path shelf shelf_static]
- shelf_static 1.1.0 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.1 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_map_stack_trace 2.1.0 [path stack_trace source_maps]
- source_maps 0.10.10 [source_span]
- source_span 1.8.1 [collection path term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- string_scanner 1.1.0 [charcode source_span]
- sync_http 0.3.0
- term_glyph 1.2.0
- test_api 0.3.0 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- test_core 0.3.19 [analyzer async args boolean_selector collection coverage glob io meta package_config path pedantic pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api]
- typed_data 1.3.0 [collection]
- universal_platform 0.1.3
- vector_math 2.1.0
- vm_service 6.2.0
- watcher 1.0.0 [async path pedantic]
- web_socket_channel 2.1.0 [async crypto stream_channel]
- webdriver 3.0.0 [archive matcher path stack_trace sync_http]
- webkit_inspection_protocol 1.0.0 [logging]
- yaml 3.1.0 [collection source_span string_scanner]```

</details>

---

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions