question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add Firestore emulator support?

See original GitHub issue

Right now when trying to connect to locally hosted Firestore emulator from Unity a mysterious exception is thrown:

Firebase.Firestore.FirestoreException : 
false for 'get' @ L6
---
at Firebase.Firestore.Internal.Util.FlattenAndThrowException (System.Threading.Tasks.Task completedTask) [0x00016] in Z:\tmp\tmp.DnKB31Zq3X\firebase\firestore\client\unity\proxy\Util.cs:94 
  at Firebase.Firestore.Internal.Util+<MapResult>c__AnonStorey0`2[T,U].<>m__0 (System.Threading.Tasks.Task`1[TResult] completedTask) [0x00000] in Z:\tmp\tmp.DnKB31Zq3X\firebase\firestore\client\unity\proxy\Util.cs:59 

After debugging SDK C# code I found out that error code of 7 (PermissionDenied) is also present.

I use these settings:

Settings.Host = "localhost:8080";
Settings.SslEnabled = false;
Settings.PersistenceEnabled = false;

I desperately need to support Firestore emulator in Unity. I will try to build SDK from source and implement emulator support myself.

How hard will it be? Does CPP SDK support emulator? Is it known where the problem lies?

I looked inside Android/Java Firebase SDK and it does not seem to be doing anything special besides setting port, host, ssl and persistence.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dconeybecommented, Oct 12, 2021

I’ve logged b/202835732 (for Googlers) to see what we can do to improve the error message produced when a Firestore operation is rejected by security rules.

1reaction
dconeybecommented, Oct 8, 2021

A quick Google search brought me to this post: https://stackoverflow.com/a/62171642/12975006

Could you ensure that your security rules in the emulator are sufficiently permissive to allow the writes?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect your app to the Cloud Firestore Emulator - Firebase
Connect your app to the Cloud Firestore Emulator · Choose a Firebase project · Instrument your app to talk to the emulators ·...
Read more >
Install, configure and integrate Local Emulator Suite - Firebase
On this page · Install the Local Emulator Suite · Configure Emulator Suite. Port configuration · Start up emulators · Export and import...
Read more >
Emulate Firestore locally
Run the following command to start the emulator: gcloud emulators firestore start. The emulator prints the host and port number where it is...
Read more >
The Full Guide on how to use the Firebase Emulator ...
First, we'll go through the process of installing the emulator and the different APIs we'll use, like, Authentication, Firestore, and Functions. Second, we'll ......
Read more >
Firebase Emulator: Firebase Services on Localhost
Setting up Firebase Emulator · 1. Initialise your Firestore · 2. Define your localhost; the host is different for Android and iOS ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found