Expo + firebase: Could not reach Cloud Firestore

Please provide the following:

  1. SDK Version:44
  2. Platforms(Android/iOS/web/all):Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

Using Expo 44, my app can fetch Firestore content properly in Expo Go with expo start . But when publishing with expo run:android , it gives following error, while auth is working properly.

[2022-06-06T03:33:09.084Z]  @firebase/firestore: Firestore (9.8.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.   
Setting a timer for a long period of time, i.e. multiple minutes, is a performance and correctness issue on Android as it keeps the timer module awake, and timers can only be called when the app is in the foreground. See https://github.com/facebook/react-native/issues/12981 for more info.
(Saw setTimeout with duration 392773ms)

Possible Unhandled Promise Rejection (id: 1):
FirebaseError: Failed to get document because the 
client is offline.
construct@[native code]

I am using older version of firebase:

import firebase from "firebase/compat/app"
import firestore from 'firebase/compat/firestore';

const firebaseConfig = {
  apiKey: "",
  authDomain: "",
  projectId: ",

// Initialize Firebase
const app = firebase.initializeApp(firebaseConfig);
const db = app.firestore();
export default app;

Please help!! Thanks!

Seems like an issue with Firebase JS SDK. There is an open GitHub issue on their repo with a possible resolution to this. Please try following the config instructions from that link.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.