'How do I fix "Could not reach Cloud Firestore Backend" error?

I'm build a simple app and I keep getting this error:

"W/Firestore: (23.0.1) [OnlineStateTracker]: 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."

I'm not sure why since my Wifi is at full strength. Can anyone assist with this issue? I'm using Java, Android Studio, and I'm testing my app with a Virtual Device.

I'm adding my code at the bottom. All this code is in my OnCreate method.

DocumentReference mDocRef = FirebaseFirestore.getInstance().document(document_path);
    mDocRef.get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
        @Override
        public void onSuccess(DocumentSnapshot documentSnapshot){
            if(documentSnapshot.exists()){
                int Rent_amount = (int) documentSnapshot.get(Rent);
                int Food_amount = (int) documentSnapshot.get(Food);
                int Bills_amount = (int) documentSnapshot.get(Bills);

                TextView Rent_test = (TextView) findViewById(R.id.rent_view);
                Rent_test.setText(String.valueOf(Rent_amount));

                TextView Food_test = (TextView) findViewById(R.id.Food_view);
                Food_test.setText(String.valueOf(Food_amount));

                TextView Bills_test = (TextView) findViewById(R.id.Bills_view);
                Bills_test.setText(String.valueOf(Bills_amount));
            }
        }
    });

Thank you so much for your help!



Solution 1:[1]

I solved this problem. I changed the type of Virtual Device to one without the Google Play Symbol.

Solution 2:[2]

If you are using Android Studio, Go to

  1. AVD Manager
  2. Your virtual devices
  3. Drop down by the right-hand side of the device
  4. Wipe Data
  5. Cold Boot

This should fix your issue

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Silas Ogar