2

When I make app working with firebase or getting data from an api ( Only for first time ) waiting like 10+ minutes for create an account on firebase or waiting 5+ minute geting 2x text from an api.

When program run for Example creating an account on firebase :

1st Time = 15+ minute . 2nd 3rd .... time = 2 second max. ( like everyone )

But when I close program and run waiting 10+ minute again.

So boring I deleted Android Studio and installed again ( doesnt work ) I did like everything what can I do . Also Formatted pc re-install everything still have same problem .

Problem not about Firebase I guess . I have same problem when using an API geting 2x string takes 5-10 minutes .

Anand
  • 4,355
  • 2
  • 35
  • 45
Nick
  • 73
  • 7
  • There's a good chance that the response gets cached after the 1st try, and that's why it's much faster on subsequent tries. Try disabling caching on all requests, and see if this is still the case – user496854 Aug 17 '22 at 22:02
  • Your question is not very clear. Are you complaining about your emulator's internet speed in general? If so, check emulator's `Extended Controls > Cellular > Network type and/or Signal strength` – ocos Aug 17 '22 at 22:03
  • Show us also the code that produces such a delay. – Alex Mamo Aug 18 '22 at 09:17
  • Not about code . Same problem on all apps . Yes i tried 6x different emulator also tried all Celluar -> network types . Also formatted pc still same . Also installed android studio another pc still same problem on other pc too . My internet connection speed -> 950mbit download / 950 upload . ( Was no any problem before 2-3 days ) i did nothing got this problem randomly didnt change anything tbh – Nick Aug 18 '22 at 11:59
  • Hi Nick, I have the same problem. A week ago my project worked well in my android emulator but since 3-4 days, it takes like 4 minutes to log in to firebase and I reseted my computer and still happening the same. Have you discovered anything? – LexFerrinson Aug 19 '22 at 10:22
  • @ocos What happens is that requests to firebase take minutes to complete (for instance signinwithemailandpassword). However it is only in the emulator since in a real device it works well. Moreover in another computer has worked for me. May it be something about firewall and windows last updates? – LexFerrinson Aug 19 '22 at 10:24
  • @AlexMamo the code is just an await for signinwithemailandpassword. It just waits there for minutes. And after it sign in, you can repeat the operation with no delay, but if you try to do another operation for instance in a realtime database, it takes minutes again. It wasn't happening a week ago, but I'm pleased other people is in my same situation, – LexFerrinson Aug 19 '22 at 10:25
  • "Same problem on all apps" means for me the problem is not related to Firebase. @LexFerrinson's solution may help you as well. – ocos Aug 19 '22 at 13:53
  • Consider changing the title of the question to: "Android emulator taking too long to do a request to firebase" – LexFerrinson Aug 19 '22 at 14:37

1 Answers1

3

I think I found the solution to this huge problem. The problem is Android emulator ver 31.3.10 beta 1 which is the emulator version that android studio installs automatically (I don't get Why they install a beta but...).

The solution is install a previous version of android emulator (you can find your current version in Sdk manager > Sdk tools > Android emulator.

What you have to do is go to this emulator archive versions page: https://developer.android.com/studio/emulator_archive and download the version 31.2.9 which is the last stable version. Just follow the installation steps above and restart android studio and firebase will work correctly.

Inside android studio, remember to install the sdk platform and sdk build tools (press on show package details to install previous versions) according to your phone emulator version. For instance I'm using API 32 so I've installed sdk platform > Android API 32 and Sdk build-tools 32.1.0-rc1

It has just worked for me and believe me I'm truly happy :)

LexFerrinson
  • 163
  • 7