I am using Android Studio 2.3(Latest). Till yesterday it was all good and working, today emulator is not connecting to the data network.
I couldn\'t find any solution wo
There was an update available to my Android Studio, i updated it and it worked!
For me the issue appears to stem from the DNS settings my company enforces.
In order to be able to get network access for my emulator I needed to launch the emulator with the same corporate dns-server specified.
I'm on a Mac, so first I checked my network settings to find what my DNS was set to:
System Preferences -> Network -> Wi-Fi -> Advanced -> DNS
Then navigated to the sdk emulator location (for convenience):
cd ~/Library/Android/sdk/emulator
Then listed the available emulators:
./emulator -list-avds
Then ran the desired emulator with dns server override:
./emulator @<emulator_name> -dns-server <dns.server.ip.address>
It would be nice if I could set this DNS to be used by emulators launched through Android Studio, but hopefully these steps help someone else in a similar position.
Couldn't find any solution by tweaking network settings. So added a new virtual device from Tools -> Android ->AVD Manager by downloading a new system image(Android O, API 26). And it's working now.
If you want to use the same API level then make sure to delete the existing system image and download it again.