Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.13.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. #25759

Closed
monkingame opened this issue Dec 25, 2018 · 4 comments

Comments

@monkingame
Copy link

monkingame commented Dec 25, 2018

Following the steps of flutter firebase in codelabs,but got errors when add firebase dependencies.

Steps to Reproduce

  1. using flutter create test01

  2. Follow the codelabs flutter-firebase

  1. Create a new Flutter app & update dependencies
    https://codelabs.developers.google.com/codelabs/flutter-firebase/#3
  1. Add cloud_firestore: ^0.8.2 to pubspec.yaml
dependencies:
  flutter:
    sdk: flutter
  cloud_firestore: ^0.8.2
  1. run demo
    get errors:
    The default Firebase app has not yet been configured.

Logs

Launching lib/main.dart on iPhone 8 in debug mode...
Xcode build done.                                            8.6s
5.13.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
5.13.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
5.13.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
*** First throw call stack:
(
0   CoreFoundation                      0x0000000110f121bb __exceptionPreprocess + 331
1   libobjc.A.dylib                     0x00000001104b0735 objc_exception_throw + 48
2   CoreFoundation                      0x0000000110f12015 +[NSException raise:format:] + 197
3   Runner                              0x000000010c292f60 +[FIRApp configure] + 576
4   Runner                              0x000000010c6834ec -[FLTCloudFirestorePlugin init] + 188
5   Runner                              0x000000010c683399 +[FLTCloudFirestorePlugin registerWithRegistrar:] + 297
6   Runner                              0x000000010c0ddf5b +[GeneratedPluginRegistrant registerWithRegistry:] + 123
7   Runner                        <…>
5.13.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
5.13.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
5.13.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
*** First throw call stack:
(
0   CoreFoundation                      0x000000010535f1bb __exceptionPreprocess + 331
1   libobjc.A.dylib                     0x00000001048fd735 objc_exception_throw + 48
2   CoreFoundation                      0x000000010535f015 +[NSException raise:format:] + 197
3   Runner                              0x00000001007c3f60 +[FIRApp configure] + 576
4   Runner                              0x0000000100bb44ec -[FLTCloudFirestorePlugin init] + 188
5   Runner                              0x0000000100bb4399 +[FLTCloudFirestorePlugin registerWithRegistrar:] + 297
6   Runner                              0x000000010060ef5b +[GeneratedPluginRegistrant registerWithRegistry:] + 123
7   Runner                        <…>
Analyzing test01...
No issues found! (ran in 2.4s)
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    ✗ Android license status unknown.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] VS Code (version 1.30.1)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.
@shadowsheep1
Copy link

shadowsheep1 commented Dec 27, 2018

I guess that your Unhandled exception is because the file ./ios/Runner/GoogleService-Info.plist is missing. Did you check it out?

Follow the steps from #5 to #6 to see how create and use this file.

Anyway even with the ./ios/Runner/GoogleService-Info.plist file correctly in place, the App works fine but you'll get this message:

5.15.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure]; (FirebaseApp.configure() in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.

I check the plugin out and we reach this point:

screenshot 2018-12-27 at 02 01 37

And that's good ^_^, because that's why with the firebase config file set we run correctly.

@monkingame
Copy link
Author

monkingame commented Dec 27, 2018

Thanks, I put the file GoogleService-Info.plist under ios/Runner, the same log appears:

5.13.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.

But it seemed app connected to firebase.
And new error occurs:

5.13.0 - [Firebase/Firestore][I-FST000001] Could not reach Cloud Firestore backend. Backend didn't respond within 10.000000 seconds.
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

The full log is:

Launching lib/main.dart on iPhone 8 in debug mode...
Xcode build done.                                            8.1s
5.13.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
5.13.0 - [Firebase/Analytics][I-ACS023007] Analytics v.50300000 started
5.13.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
5.13.0 - [Firebase/Firestore][I-FST000001] The behavior for system Date objects stored in Firestore is going to change AND YOUR APP MAY BREAK.
To hide this warning and ensure your app does not break, you need to add the following code to your app before calling any other Cloud Firestore methods:
let db = Firestore.firestore()
let settings = db.settings
settings.areTimestampsInSnapshotsEnabled = true
db.settings = settings
With this change, timestamps stored in Cloud Firestore will be read back as Firebase Timestamp objects instead of as system Date objects. So you will also need to update code expecting a Date to instead expect a Timestamp. For example:
// old:
let date: Date = documentSnapshot.get("created_at") as! Date
// new:
let timestamp: Timestamp = documentSnapshot.get("created_at") as! Timestamp
let date: Date = timestamp.dateValue()
Please audit all existing usages of Date when you enable the new behavior. In a future release, the behavior will be changed to the new behavior, so if you d<…>
[C1.1 UUID here 127.0.0.1:58730<->127.0.0.1:1080]
Connected Path: satisfied (Path is satisfied), interface: lo0
Duration: 3.196s, , TCP @2.248s took 0.001s, TLS took 0.681s
bytes in/out: 4762/1051, packets in/out: 8/11, rtt: 0.000s, retransmitted packets: 0, out-of-order packets: 0
5.13.0 - [Firebase/Firestore][I-FST000001] Could not reach Cloud Firestore backend. Backend didn't respond within 10.000000 seconds.
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

@zoechi
Copy link
Contributor

zoechi commented Dec 27, 2018

Duplicate of #16534

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants