firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.64k stars 3.95k forks source link

Firebase has not been correctly initialized. Have you added the "GoogleService-Info.plist" file to the project? #6960

Closed saravanans55 closed 3 years ago

saravanans55 commented 3 years ago

I have included a GoogleService-Info.plist in the "ios/Runner/" folder. but still facing this issue while build/run the app. I tried all the ways, flutter clean, invalidate and restart, flutter get, flutter upgrade, removed the ios folder, removed and add the podfile, podfile.lock. No Luck... Anyone please help me?

Error Log:

Launching lib/main.dart on iPhone 12 Pro Max in debug mode... Running Xcode build... Xcode build done. 28.1s Debug service listening on ws://127.0.0.1:56340/eT56OFzr0F8=/ws Syncing files to device iPhone 12 Pro Max... [VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: [core/not-initialized] Firebase has not been correctly initialized. Have you added the "GoogleService-Info.plist" file to the project?

Flutter doctor Log:

Doctor summary (to see all details, run flutter doctor -v): Unable to find any JVMs matching version "1.8". Unable to find any JVMs matching version "1.8". [✓] Flutter (Channel stable, 2.2.3, on Mac OS X 10.15.7 19H1323 darwin-x64, locale en-IN) ⣯Unable to find any JVMs matching version "1.8". [✓] 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 2020.3) ✗ Unable to find bundled Java version. [✓] Connected device (2 available)

! Doctor found issues in 1 category.

markusaksli-nc commented 3 years ago

Hi @saravanans55 Have you just added it to the folder or did you add it through Xcode? Could you also provide your flutter pub deps -- --style=compact? Thank you

saravanans55 commented 3 years ago

@markusaksli-nc thanks for the reply. below i added the result log.

platform_app % flutter pub deps -- --style=compact
Dart SDK 2.13.4
Flutter SDK 2.2.3
platform_app 1.0.0+1

dependencies:
- async 2.6.1 [meta collection]
- cupertino_icons 1.0.3
- dio 4.0.0 [http_parser path]
- firebase_core 1.6.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_messaging 10.0.6 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- flutter_easyloading 3.0.3 [flutter flutter_spinkit]
- flutter_html 2.1.2 [html csslib flutter_layout_grid video_player chewie webview_flutter chewie_audio flutter_svg flutter_math_fork collection numerus flutter]
- flutter_local_notifications 8.1.1+2 [flutter flutter_local_notifications_platform_interface platform timezone]
- flutter_native_splash 1.2.1 [args image meta path xml yaml universal_io]
- fluttertoast 8.0.8 [flutter flutter_web_plugins]
- font_awesome_flutter 9.1.0 [flutter]
- http 0.13.3 [async http_parser meta path pedantic]
- localstorage 4.0.0+1 [flutter path_provider]
- mqtt_client 9.6.0 [typed_data event_bus path crypto meta]
- splashscreen 1.3.5 [flutter]
- toast 0.1.5 [flutter]
- universal_html 2.0.8 [async csslib charcode collection html meta source_span typed_data universal_io]
- web_socket_channel 2.1.0 [async crypto stream_channel]
- webview_flutter 2.0.12 [flutter]

dev dependencies:
- 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]

transitive dependencies:
- archive 3.1.2 [crypto path]
- args 2.2.0
- boolean_selector 2.1.0 [source_span string_scanner]
- characters 1.1.0
- charcode 1.2.0
- chewie 1.1.0 [cupertino_icons flutter video_player wakelock]
- chewie_audio 1.2.0 [cupertino_icons flutter video_player]
- clock 1.1.0
- collection 1.15.0
- crypto 3.0.1 [collection typed_data]
- csslib 0.17.0 [source_span]
- event_bus 2.0.0
- fake_async 1.2.0 [clock collection]
- ffi 1.1.2
- file 6.1.2 [meta path]
- 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_messaging_platform_interface 3.0.5 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 2.0.5 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- flutter_layout_grid 1.0.3 [flutter collection meta quiver]
- flutter_local_notifications_platform_interface 4.0.1 [flutter plugin_platform_interface]
- flutter_math_fork 0.4.0+1 [flutter flutter_svg provider meta collection tuple]
- flutter_spinkit 5.1.0 [flutter]
- flutter_svg 0.22.0 [flutter meta path_drawing vector_math xml]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- html 0.15.0 [csslib source_span]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- image 3.0.2 [archive meta xml]
- js 0.6.3
- matcher 0.12.10 [stack_trace]
- meta 1.3.0
- nested 1.0.0 [flutter]
- numerus 1.1.1
- path 1.8.0
- path_drawing 0.5.1 [vector_math meta path_parsing flutter]
- path_parsing 0.2.1 [vector_math meta]
- path_provider 2.0.3 [flutter path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows]
- path_provider_linux 2.0.2 [flutter path path_provider_platform_interface xdg_directories]
- path_provider_macos 2.0.2 [flutter]
- path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface]
- path_provider_windows 2.0.3 [ffi flutter meta path path_provider_platform_interface win32]
- pedantic 1.11.1
- petitparser 4.1.0 [meta]
- platform 3.0.2
- plugin_platform_interface 2.0.1 [meta]
- process 4.2.3 [file path platform]
- provider 6.0.0 [collection flutter nested]
- quiver 3.0.1 [matcher]
- sky_engine 0.0.99
- 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]
- 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]
- timezone 0.8.0 [path]
- tuple 2.0.0 [quiver]
- typed_data 1.3.0 [collection]
- universal_io 2.0.4 [collection crypto meta typed_data]
- vector_math 2.1.0
- video_player 2.1.15 [flutter meta video_player_platform_interface video_player_web]
- video_player_platform_interface 4.1.0 [flutter meta flutter_test]
- video_player_web 2.0.3 [flutter flutter_web_plugins meta video_player_platform_interface]
- wakelock 0.5.3+3 [flutter meta wakelock_macos wakelock_platform_interface wakelock_web wakelock_windows]
- wakelock_macos 0.1.0+2 [flutter flutter_web_plugins wakelock_platform_interface]
- wakelock_platform_interface 0.2.1+2 [flutter meta]
- wakelock_web 0.2.0+2 [flutter flutter_web_plugins js wakelock_platform_interface]
- wakelock_windows 0.1.0+1 [flutter wakelock_platform_interface win32]
- win32 2.2.9 [ffi]
- xdg_directories 0.2.0 [meta path process]
- xml 5.1.2 [collection meta petitparser]
- yaml 3.1.0 [collection source_span string_scanner]
markusaksli-nc commented 3 years ago

Have you just added GoogleService-Info.plist to the folder or did you add it through Xcode?

saravanans55 commented 3 years ago

I added GoogleService-Info.plist inside the Runner folder. Please find in the below image. https://ibb.co/1rx3cgn

saravanans55 commented 3 years ago

@markusaksli-nc I troubleshoot the issue, I thought xcode will automatically detect the GoogleService-Info.plist from the Runner folder, But it will not, in flutter page they directly mentioned this but not shown in the error log. After I go-through this https://firebase.flutter.dev/docs/installation/ios/. I got the solution, After that i added the plist manually via the xcode and build successfully.

Thanks @markusaksli-nc

markusaksli-nc commented 3 years ago

Glad I could help, closing this as solved