0

I successfully had the firebase auth emulator working a few days ago, but it has mysteriously stopped working. I get a generic network error when trying to authenticate with any platform. I am using a physical device via USB. When I navigate to the emulator address and port on the device, I get the appropriate json response, so I think the connection should be fine. Authentication without emulator is working.

I have this in my application launch

func application(_ application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    FirebaseApp.configure()
    Auth.auth().useEmulator(withHost:"192.168.0.10", port:9099)
    
    let settings = Firestore.firestore().settings
    settings.host = "192.168.0.10:9098"
    settings.cacheSettings = MemoryCacheSettings()
    settings.isSSLEnabled = false  // required when pointing to emulator
    Firestore.firestore().settings = settings
    
    return true
}

I also have this firebase.json configuration

{
  "firestore": {
    "database": "(default)",
    "location": "nam5",
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "emulators": {
    "auth": {
      "port": 9099,
      "host": "0.0.0.0"
    },
    "firestore": {
      "port": 9098,
      "host": "0.0.0.0"
    },
    "ui": {
      "enabled": true
    },
    "singleProjectMode": true
  }
}

I tried adding this path as well

export FIREBASE_AUTH_EMULATOR_HOST="192.168.0.10:9099"

I have cleaned my build, deleted the app from my device, cleared derived data.

Thoughts on what else I should check?

2
  • 1
    "it has mysteriously stopped working" isn't much for us to work with. Could you edit the question to be more specific about what isn't working the way you expect? Are there any errors? What steps can we take to duplicate that observation? Commented 18 hours ago
  • @DougStevenson I get a generic network error when trying to authenticate with any platform. Don't have it in front of me now, but it suggests network timeout or other issues could be the reason, but doesn't specify which. Commented 17 hours ago

0

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.