0

I have set up my firebase emulator up an running enter image description here

On my main programm, at the start of my flutter web app I have the following code:

void main() async {

  WidgetsFlutterBinding.ensureInitialized();
   await Firebase.initializeApp();

  FirebaseFirestore.instance.settings = Settings(
    host: '127.0.0.1:8080',
    sslEnabled: false,
  );

Yet when I try to get the document I get the following error:

Failed to get Document because the client is offline

My firebase.json is the following:

{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "hosting": {
    "public": "build/web",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  },
  "emulators": {
    "firestore": {
      "port": 8080
    },
    "hosting": {
      "port": 5000
    },
    "ui": {
      "enabled": true
    }
  }
}
6

1 Answer 1

2

Turns out everything was set up correctly. The reason I could not communicate with the Firebase Emulator was my Karspersky antivirus. If anyone else has the same issue try to disable your additional antivirus.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.