0

I have used Firebase for 2 years, and suddenly it stopped receiving any data from the emulator, but at the same time, it receives from an actual device !!!

My Code:

val database =Firebase.database
val myRef = database.getReference("message")
uploadButton.setOnClickListener { 
  myRef.setValue("Hello, World!") 
}

What I have tried

  • Used multiple different emulators (those with google play) with different SDK
  • Changed SHA1 and google-services.json
  • In Settings -> Appearance & Behavior -> SDK Tools downloaded and activated Google play service
  • Reinstalled Android Studio
  • Installed Windows 10 again
  • Updated Google Play services version
  • Tried different projects on different firebase accounts
  • Activated Sign-in methods in the firebase console
  • Upgraded billing plan in firebase
  • Disabled the firewall
  • Disabled the anti-virus
  • I opened all the ports
  • Searched the web for several days and did many other things I can't even remember now
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Amr Diab
  • 1
  • 2
  • 1
    "it stopped receiving any data" doesn't provide enough information so we can help. What is the code that behaves that way? Do you have any errors? – Alex Mamo Aug 17 '22 at 10:36
  • I used a very basic code to test the firebase real-time database, and I tried all the solutions I get from the internet, – Amr Diab Aug 17 '22 at 10:48
  • and this is a same question link : https://stackoverflow.com/questions/73370728/firebase-doesnt-work-on-android-studio-emulator – Amr Diab Aug 17 '22 at 10:49
  • 1
    Please provide enough code so others can better understand or reproduce the problem. – Community Aug 17 '22 at 11:03
  • it is a very basic code and it doesn't work ////////////////////////////////////// val database =Firebase.database val myRef = database.getReference("message") uploadButton.setOnClickListener { myRef.setValue("Hello, World!") } //////////////////////////////// – Amr Diab Aug 17 '22 at 11:06
  • I have seen a very similar problem this week: A project nicely working inside the Android emulator now fails receiving data from a firebase realtime database, just after I upgraded the emulator to version 31.3.10 (as suggested by Android Studio). I could repeat the same problem on an independent system (both: Windows 10, up to date Android studio version, project upgraded to newest SDK). Also there after upgrading the emulator, access to the database fails. Unfortunately I do not remember the version number of the emulator that still worked. I just know it is was about 4 month older. – Michael Aug 18 '22 at 08:00

1 Answers1

0

the problem was solved when I downgraded the emulator version, and this is the answer that helped me : https://stackoverflow.com/a/73395525/17225971

Amr Diab
  • 1
  • 2