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.

Firestore not working on android emulator new Expo Go app and 46.0.7 SDK. Throwing Errors

See original GitHub issue

Summary

It seems like the new Expo Go app on android studio emulator can’t reach internet connection. I have a strong internet connection. But It is throwing these errors:

ERROR  [2022-08-15T19:48:15.318Z]  @firebase/firestore: Firestore (9.9.2): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in 
offline mode until it is able to successfully connect to the backend.
 WARN  Possible Unhandled Promise Rejection (id: 0):
Error: Failed to get document because the client is offline.
http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:336871:26
generatorResume@[native code]
asyncGeneratorStep@http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25072:26_throw@http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:25098:29
tryCallOne@http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:30570:16        
http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:30671:27
http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:31750:26
_callTimer@http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:31650:17        
_callReactNativeMicrotasksPass@http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:31685:17
callReactNativeMicrotasks@http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:31892:44
__callReactNativeMicrotasks@http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:24002:46
http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:23781:45
__guard@http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:23985:15
flushedQueue@http://192.168.0.107:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false:23780:21      
flushedQueue@[native code]
callFunctionReturnFlushedQueue@[native code]

image

But working on the real device, there are no errors.

What platform(s) does this occur on?

Android, iOS

Environment

  expo-env-info 1.0.5 environment info:
    System:
      OS: Windows 10 10.0.22000
    Binaries:
      Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.19 - ~\.yarn\bin\yarn.CMD
      npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: AI-212.5712.43.2112.8815526
    npmPackages:
      expo: ^46.0.7 => 46.0.7
      react: 18.0.0 => 18.0.0
      react-native: 0.69.4 => 0.69.4
    Expo Workflow: managed

Minimal reproducible example

image image image

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12

github_iconTop GitHub Comments

5reactions
dylanrandlecommented, Oct 19, 2022

I was able to resolve this by replacing

const firestore = getFirestore(app)

with

const firestore = initializeFirestore(app, { experimentalAutoDetectLongPolling: true })

as indicated here.

1reaction
lucasrangellcommented, Nov 15, 2022

I was able to resolve this by replacing

const firestore = getFirestore(app)

with

const firestore = initializeFirestore(app, { experimentalAutoDetectLongPolling: true })

as indicated here.

Finally! I have tried a lot of possibilities but none of them worked… That one works like a charm! Thanks!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo firebase / firestore Android emulator - Expo SDK - Forums
Hello, I am trying to build an app using Expo and firebase. But during the development, I run into issues I couldn't resolve...
Read more >
Why I am getting Expo Firestore error: Could not reach Cloud ...
For testing I created a fresh project, then installed firebase with "npx expo install firebase". I Initialized firebase, then logged in with " ......
Read more >
ToDo List Expo React Native App with Firebase Authentication ...
Hi everyone!I've been a bit less active lately as I've been working on a longer tutorial covering building a todo app in react...
Read more >
How to integrate react-native-firebase with Expo | Medium
A guide showing the new way of integrating react-native-firebase into Expo managed workflow, using new awesome Expo features: Config Plugins ...
Read more >
Integrating Firebase authentication into an Expo mobile app
By the end, we will have a running mobile application with the following functionalities: Sign-up and login screens (using email and password) ...
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