DEV Community

kamasuPaul
kamasuPaul

Posted on

"Connecting to emulator" taking long in android studio solution

You have probably installed a new version of android studio, and then all of a sudden the emulator is not opening . It keeps displaying the message

Connecting to emulator.
and this is probably taking longer than usual.

I faced this same issue after installing anew version of android studio. I tried the following solutions from stack overflow

  1. Creating a new emulator
  2. Cold booting the emulator
  3. Wiping the emulator data

All these solutions did not work.

The solution.

So how did i solve this problem of emulator taking long and most importantly how can you solve it as well.

The emulator is taking long to connect mostly probably because your android emulator sdk is out of date.
So the solution to uninstall it or update.
To do this, head over to android studio

  1. From the toolbar of android studio open Tools
  2. Then select Sdk manager from the dropdown menu
  3. The android sdk section should appear.
  4. Under the 'Android sdk' section, select SDK tools tab.
  5. Under the SDK tools tab look for the android emulator
  6. Uncheck the box appearing besides the android emulator and click apply button to unistall the emulator
  7. After uninstalling, it should now display as not installed. check the box again to install the emulator again. After installation it should appear as installed. Close android studio and open it again

And now when you click run the emulator should open as expected.
Hopefully this solves your problem as it solved mine.

Oldest comments (2)

Collapse
 
omwaka profile image
Ben Okello

Nice Piece

Collapse
 
lenkapolaskova profile image
lenkapolaskova • Edited

Hi,
in may case it did not help. I have spent several hours to run the emulator.
First, from logs I realized there was something wrong with the OpenGl (Help -> Show Log In explorer). I don' t know why because I have already run emulator just fine yesterday.
So I decided to change the rendering from Hw to Sw but this option was grayed out in AVD manager so I needed to find a config.ini of the virtual device and change hw.gpu.mode to swiftshader. After that the loading took too long.
So I have opened the command line and run the VD from emulator with
C:\Users\lenka\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -avd Pixel_API_26
After that I could run the emulator also from AVD manager.