I have wasted a whole day trying out different solutions floating around in SO and other place mentioned to enable wifi on the android emulator but to no avail. Can anybody
A simple cold boot worked for me, no need to start other emulators or wiping memory.
Just close your emulator and select the "Cold Boot Now" option on the drop menu adjacent to the play button. If not look for any of the more comprehensive options listed here, but I suggest always starting with the simplest solution.
Good luck!
My solution using Mac OSX 10.13
I read about it being caused by LAN card and WiFi being enabled, and some approaches seemed complicated to me, so I simply tried this, and it worked:
Maybe this would help someone. I tried all the solutions above. Changing DNS, cold booting, etc. After several hours of trial and error, I went to the official docs, which said that the emulator picks up the DNS config. of host machine at emulator's boot time. I had VMWare installed on my machine, which installs a few network adapters. So, I just changed the DNS config. of all the adapters (including VMWare adapters), and cold booted my emulator. OMG, the problem which didn't seem to go away for hours, just got right!
Now, what I find odd is, I switched back the DNS config. of all the adapters to auto, and cold booted my emulator again. The WiFi still works just fine. OS: Windows 10.
Wipe data by right clicking on virtual device list & cold boot works for me..
What worked for me:
Change the location of the emulator and set it to your current location.
Steps : -