Replies: 81 comments 33 replies
-
Hi @kaiserleka,
Thanks. |
Beta Was this translation helpful? Give feedback.
-
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()"
|
Beta Was this translation helpful? Give feedback.
-
@kaiserleka,
|
Beta Was this translation helpful? Give feedback.
-
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 :( |
Beta Was this translation helpful? Give feedback.
-
@kaiserleka - is your macos app in App Sandbox mode, and if so, did you add the com.apple.security.network.client entitlement? |
Beta Was this translation helpful? Give feedback.
-
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.
|
Beta Was this translation helpful? Give feedback.
-
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.
|
Beta Was this translation helpful? Give feedback.
-
Could you share those files and related macos files just in case? Your dart code still giving that error @evanpon |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Anyone found a solution for this. I have been trying for the last two days and couldnt find a solution. |
Beta Was this translation helpful? Give feedback.
-
[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. |
Beta Was this translation helpful? Give feedback.
-
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: |
Beta Was this translation helpful? Give feedback.
-
Same error on iOS 14 physical device. Anyone found a solution ? |
Beta Was this translation helpful? Give feedback.
-
Same issue on macos with firebase_core 0.5.1 and cloud_firestore 0.14.2 |
Beta Was this translation helpful? Give feedback.
-
Facing the same issue. |
Beta Was this translation helpful? Give feedback.
-
In my case I forgot to check exist
fixed by add check exits
|
Beta Was this translation helpful? Give feedback.
-
Emulator version 31.3.11 solved my problem. |
Beta Was this translation helpful? Give feedback.
-
FirebaseException ([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.) |
Beta Was this translation helpful? Give feedback.
-
I am re-facing this issue now with my project, after more than a year with 0 unavailable error. I was about to release my first beta to our test users, I am now totally blocked with no idea on what I can do. Am I the only one in that case?
|
Beta Was this translation helpful? Give feedback.
-
This is happening to me on iOS simulator using cloud_firestore |
Beta Was this translation helpful? Give feedback.
-
Same issue here. :( But also happens on 4.4.3 :( |
Beta Was this translation helpful? Give feedback.
-
I've been grappling with this over the last few days and the repeatable behaviour I've been able to produce is this:
For example, the below DOESN'T raise the error: var collectionRef = FirebaseFirestore.instance.collection('tags');
var tags = await collectionRef.get(GetOptions(source: source))); However, the below DOES raise the error (only when offline): var collectionRef = FirebaseFirestore.instance.collection('tags');
var doc = await collectionRef.doc(id).get(GetOptions(source: source)); //where id doesn't exist for this collection For both of the above I have confirmed that the correct data is stored in the cache when offline What is also strange is making this call online first, then going offline doesn't cause the error but if the device is offline the first time the call is made raises the error. This is an example of how I combatted the error: try {
// Private class that stores online state
Source source =
NetworkStatus().deviceIsOnline ? Source.serverAndCache : Source.cache;
var collectionRef = FirebaseFirestore.instance.collection('tags');
var doc = await collectionRef.doc(id).get(GetOptions(source: source));
return doc.exists;
} on FirebaseException catch (e) {
print('Firebase error ' + e.code.toString());
return false;
} catch (e) {
throw e;
} |
Beta Was this translation helpful? Give feedback.
-
Now that this is fully understood (thanks @cammoore54) I've raised an actual issue so we can get this addressed as it straight up breaks apps: |
Beta Was this translation helpful? Give feedback.
-
What worked for me
|
Beta Was this translation helpful? Give feedback.
-
I am still having this issue. Has anyone solved it yet? |
Beta Was this translation helpful? Give feedback.
-
I am still facing this issue... When firestore throws an error they are not clear like for which document error is being thrown or which line of code... Debugging is very difficult... |
Beta Was this translation helpful? Give feedback.
-
Check your code if you are trying to fetch and update the same document at
a same time.
Thanks and Regards,
Ayesha Iftikhar
…On Mon, 8 Apr 2024 at 11:34 PM, G.V.S Akhil ***@***.***> wrote:
I am still facing this issue... When firestore throws an error they are
not clear like for which document error is being thrown or which line of
code... Debugging is very difficult...
—
Reply to this email directly, view it on GitHub
<#5708 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APDNEYWWABQRV522DXK2UBLY4LPKPAVCNFSM42XQ3UO2U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TSMBVGAYDCMQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I was able to resolve this issue by getting off of the spark plan and then redoing my database collection, thankfully I didn't have data to restore but this worked out for me. |
Beta Was this translation helpful? Give feedback.
-
I encountered the same error yesterday : [cloud_firestore/unavailable] The service is currently unavailable. This is most likely a transient condition and may be resolved by retrying with a backoff. This issue persisted for around 3 to 4 hours, and the cause turned out to be quite simple: I had just enabled and created my Firestore Database service a few minutes before attempting to add data to it. In the past, I had always used the default database name, but this time I named it something different, for example, 'example'. If you choose a custom database name, you need to specify the database ID or name in the instance like this: FirebaseFirestore.instanceFor(app: Firebase.app(), databaseId: 'example'); I hope this helps anyone facing the same issue ! ☀️ |
Beta Was this translation helpful? Give feedback.
-
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
Beta Was this translation helpful? Give feedback.
All reactions