-
Notifications
You must be signed in to change notification settings - Fork 4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
🐛 [CLOUD_FIRESTORE] The service is currently unavailable. #3521
Comments
Hi @kaiserleka,
Thanks. |
I have created a new Flutter project and enabled desktop support.
I have added both of that packages to pubspec.yaml
I have created new Firestore project and created a collection named "testCollection"
4.1 I have name my named my project
I have located that stateful example onto my main.dart. When I run it, it works
I have added
I have updated my code with firestore. Event I run Firebase.initializeApp(), it says "[core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()"
|
@kaiserleka,
|
I'm getting : [core/not-initialized] Firebase has not been initialized. Please check the documentation for your platform.
Why I can't find any complete Flutter Firestore Macos project :( |
@kaiserleka - is your macos app in App Sandbox mode, and if so, did you add the com.apple.security.network.client entitlement? |
I have also added this to entitlement files but still getting : [core/not-initialized] Firebase has not been initialized. Please check the documentation for your platform.
|
My apologies, my comment wasn't very helpful without additional context. I don't know why you are getting the Firebase has not been initialized. error. I tried looking through your code, but I'm pretty new to Flutter and wasn't able to spot the issue. My comment about the entitlement was to address your original problem, which was that you were getting an error message about cloud_firestore being unavailable. That said, here is a main.dart file that successfully connects to Firestore for me on macos. I imagine all the other setup (pubspec, entitlements, etc) is now similar to mine so I won't paste it all.
|
Could you share those files and related macos files just in case? Your dart code still giving that error @evanpon |
I created a new project from scratch, and made the (I think) minimum changes to make it work for Firestore. You can see the repo and look at the commits here: https://github.com/evanpon/macos_firestore. The one piece it doesn't have is the GoogleService-Info.plist file, since you'll need that from your own project. |
I'm also looking for a solution to this error. In my case I get it only when my device (Android) is offline. I'm not able to create new documents when offline due to this exception. |
Anyone found a solution for this. I have been trying for the last two days and couldnt find a solution. |
[cloud_firestore/unavailable] The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff. it happened recently. |
Same here. Used to work like a charm but not anymore. await Firebase.initializeApp(); await authService.signinAnonymously(); // OK var documentSnapshot = await FirebaseFirestore.instance.collection('user').doc(deviceId).get(); // HANG after 10 seconds or so: |
Same error on iOS 14 physical device. Anyone found a solution ? |
Same issue on macos with firebase_core 0.5.1 and cloud_firestore 0.14.2 |
Adding the network client entitlement fixed my issue ( |
Hi, same error here, on physical Android devices. Firestore client throws same error randomly.
In my case, a network connection of those devices were active. In addition, I already implemented a retry process using the exponential backoff algorithm. However, this issue is not resolved. |
Same here. My app was working fine until about 2 weeks ago, and now I'm getting that error about 70% of the times I try and start the app |
Make sure that in your android/build.gradle there is classpath 'com.google.gms:google-services:4.3.3' |
The same is happening here #2753 |
Any solution on this? |
I also encountered this problem, but the issue has been resolved a few days back on one of my devices. |
@nelstein do you mean, as opposed to 4.3.4, or to 3.x? I am also being hit hard by this error. |
I downgraded to cloud_firestore: 0.13.6 |
I have the same error in one user in production. It's totally inappropriate behavior. |
Facing this issue too, but only on ios simulator |
Keeps happening...!! what is going on ? |
Since last December 24, the same error suddenly stopped occurring. I have not made any configuration changes or upgraded any packages. Therefore, for reasons unknown, my Sentry client has gone quiet. What about you? |
I had the issue also being solved on its own. The problem is that it's still appearing here and there which is super annoying. |
I have this issue with some users but not all. Still no fix? |
I have the same issue with cloud_firestore 0.16.0 |
I have the same issue. Same code working fine most of the time. One or two times it throws this error. Any solution for this? |
Just started getting this on ipad. |
Thanks a lot! I updated to 4.3.4 |
I just got the error in @zzterrozz comment suddenly. So I tried everything that 'maybe' solved this problem, and it works. I hope someone get rescue by this rambling solutions:
# ...
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
firebase_core: ^0.7.0
cloud_firestore: ^0.16.0+1
firebase_auth: ^0.20.1
firebase_crashlytics: ^0.4.0+1
firebase_storage: ^7.0.0
firebase_messaging: ^8.0.0-dev.15
firebase_analytics: ^7.0.1
intl: ^0.16.0
equatable: ^2.0.0
url_launcher: ^6.0.2
device_info: ^2.0.0
shared_preferences: ^2.0.3
fluttertoast: ^7.1.8
provider: ^5.0.0
flutter_html:
dio:
html: 0.14.0
# ... Today morning I upgraded to flutter 2.0. So I thought maybe it would the cause. So I tried to upgrade every firebase-related dependencies to 'null-safety version (e.g. 1.0.0)'. but it doesn't work so re-downgraded all.
[✓] Flutter (Channel stable, 2.0.1, on Mac OS X 10.15.7 19H15 darwin-x64, locale ko-KR)
• Flutter version 2.0.1 at /usr/local/Caskroom/flutter/2.0.1/flutter
• Framework revision c5a4b4029c (3 days ago), 2021-03-04 09:47:48 -0800
• Engine revision 40441def69
• Dart version 2.12.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/roeniss/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/roeniss/Library/Android/sdk
• ANDROID_SDK_ROOT = /Users/roeniss/Library/Android/sdk
• Java binary at: /Users/roeniss/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Users/roeniss/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.2)
• IntelliJ at /Users/roeniss/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.54.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)
• iPhone 11 Pro Max (mobile) • A09F8BAA-5C6A-40E7-A3D1-BACED0EB2DBC • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.192
• No issues found!
If someone need more information about my settings, please mention me. I'll gladly respond to you. edit) I encountered this again... almost got mad... when I met this issue, my app was already in login status. So i logout and login again, then this issue was gone, again. edit2) This still happen and I found that re-authentication is a temporary solution (I already used FB email login). |
Cold restarting my flutter emulator solved it for me. This can be done by setting "cold restart" in Android studio, see here: https://stackoverflow.com/questions/49949818/firebaseinstanceid-token-retrieval-failed-service-not-available |
This happened to me too (Android physical devices), but it only happened if I use release build type, if I use debug, it worked fine. It fixed after rebuilding a couple of times, so I think that it might be related to some transient issue during build time? I can only recommend to run flutter doctor
|
That error might occur whenever device is offline and there is no data inside firestore local cache. And accordingly to firebase sdk developers, it is the normal behaviour. |
@vhmolinar thanks! Can you share a link to where firebase SDK developers state that, or maybe some example code about how to work around / handle this failure, please? We're seeing this error occasionally on production / release and do not know how to work around it yet. Thanks a lot! |
Moving to discussions as this isn't an issue with FlutterFire itself. Let's continue 'discussions' there. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Bug report
I'm try to use Firestore with Flutter Deskop (MacOS). But I'm getting always this error since my first try for a month.
Steps to reproduce
(All steps on https://firebase.flutter.dev/docs/installation/macos)
Expected behavior
I wish to get name value from myDocument on Firebase
Additional context
main.dart
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: