519

I know that similar questions have been asked before, but my problem is new only after installing Android Studio 2.3, the latest version in March 2017. I have several years experience developing Android applications, and I have never encountered this problem before. After upgrading to version 2.3 of Android Studio, my emulator is no longer able to access the internet. I even uninstalled/reinstalled Android Studio 2.3 from scratch and created a new emulator, and I am still getting the same error. This is not an app problem. I can't even access the internet from Chrome, and I wasn't having this problem last week. The message that I get says that the server DNS address could not be found -- DNS_PROBE_FINISHED_BAD_CONFIG. The only thing that has changed on my computer in the last week is the new version of Android plus possibly updates to Windows 10. And yes, my computer has access to the internet. Below is an image of my emulator when I try to use Chrome to search for "Google". emulator with error message

15
  • I have discovered an additional issue with Android Studio 2.3 that is not related to internet access but could somehow be related to the one above. With Android Studio open to a project and an emulator running, I can run the app on the emulator just fine. But if I open Android Device Monitor, it tells me that the emulator is offline. Then, if I close Android Device Monitor and go back to Android Studio, it also tells me that the emulator is offline. I have to close and restart the emulator before Android Studio can find it again. This problem, like the one above, is repeatable.
    – John Moore
    Mar 11, 2017 at 14:12
  • 7
    I think this question is still good, as it is more 'general' than the cited one and also because it mentions the upgrade of Android Studio. As of april 2018, I have just upgraded it to version 3.1.2 and suddendly started to have this issue.
    – Shine
    May 5, 2018 at 16:58
  • 94
    I don't understand why we have to waste so much time on this kind of problems. Android team ...just fix it!
    – r3dm4n
    May 12, 2018 at 15:06
  • 1
    My solution was delete saved network from the emulator setting and close emulator then run it back Jun 3, 2019 at 7:22
  • 4
    I deleted the emulator device and relaunch a new one, solved. I spent half a day struggling at this issue... I'm a fool. Android team, wtf, you are better than that!!!
    – KunYu Tsai
    May 13, 2021 at 5:16

65 Answers 65

782
  • 1st try "Cold booting" the emulator as suggested here.

  • If cold booting doesn't work, try changing the DNS address of your network to 8.8.8.8 (Google's DNS) or another of your preference:

MacOSX:

  • Open "System Preferences"
  • Click on "Network"
  • Select the network which your computer is connected and click on "Advanced"
  • Select "DNS", Select the "+" button, type "8.8.8.8" (Google's DNS) or if you prefer OpenDNS, "208.67.222.222"
  • Select "Ok" and "Apply"

Windows & Linux:

https://developers.google.com/speed/public-dns/docs/using


After that close the emulator and start it again.

20
  • 32
    If you don't want your DNS traffic going through Google, use OpenDNS settings instead. 208.67.222.222 and 208.67.220.220 Oct 11, 2018 at 16:58
  • 18
    I did the same, but then had to restart the emulator to get it to work, thanks for the tip though! Oct 26, 2018 at 13:29
  • 3
    You can also instead of "brute forcing" your whole computer to use a new DNS server (And then by defaults having your emulator inherit those changes) just change the DNS settings for the emulator... There are a bunch of ways to do it. More details on the various options available here: stackoverflow.com/questions/2039964/…
    – trcarden
    Jun 16, 2019 at 17:38
  • 2
    The problem is having partially invalid DNS settings in general. Reset them to something valid, and it'll work, doesn't have to be 8.8.8.8. My Mac was set up with 3 DNS servers, the first 2 of which were invalid. It still worked for other things since the third was ok, but I'm guessing the simulator only took the first two (it's common to only have primary and secondary) or is otherwise not as robust against this misconfiguration.
    – sudo
    Nov 27, 2019 at 19:23
  • 2
    I spent 2 hrs trying to debug why my emulator couldn't talk to Firebase and realised it was this issue. Hooray for dev experience. Get a grip Android team!
    – Sameen
    Jun 12, 2020 at 17:20
421

After trying many of these solutions, I was going to just delete my current AVD and make it again, but when I clicked the down arrow on the AVD, I noticed "Cold Boot Now".

AVD Menu

On a whim I tried that. Lo and behold my emulator has internet connectivity again!

Command-line approach

In case you start Emulator through command, pass -no-snapshot-load option, like:

%ANDROID_HOME%/emulator/emulator.exe -netdelay none -netspeed full -no-snapshot-load -avd Pixel_2_API_28

Or for MacOSX:

$ANDROID_HOME/emulator/emulator -netdelay none -netspeed full -no-snapshot-load -avd Pixel_2_API_28

Note that you may need to change -avd Pixel_2_API_28 part (with your own Virtual-Device name).

Also, most tools use ANDROID_HOME environment-variable name, hence define that (if not already), but nowadays ANDROID_ROOT is yet another naming-option.

Decision (edit)

Ok, for those saying why not just wipe data and restart. Do you reformat your PC every time you restart it? Wiping data on the emulator is just like doing a factory reset to a phone or reformatting your hard drive on your PC and reinstalling your OS. It is unnecessary unless the data is totally corrupt.

When you shut off the emulator and restart it, it is like putting your PC in hibernate or sleep mode. Memory is not wiped, it is saved.

Doing a cold boot is the same as rebooting your phone or rebooting your PC. It resets memory and lets things reload. This allows the network emulation to start with clean memory and connect properly.

So, don't wipe your data. Just cold boot. If it still doesn't work, then wipe, but save that as a last resort.

13
  • 16
    This fixed it for me after switching from wired to wifi
    – Lucas
    Jun 3, 2018 at 3:24
  • 4
    Works for me too, facing the same problem switching between different networks adapters. The problems seems to be that the emulator is still somehow connected to the previous connection configuration, so when the emulator is start with Cold Boot Now the network config is restarted and everything start working again. Thanks for sharing ;)!! Jul 13, 2018 at 14:01
  • 6
    Works fine! but why?
    – ucMedia
    Feb 14, 2019 at 15:46
  • 2
    Do you wipe your phone every time you reboot? That's what a cold start is on the emulator, a cold reboot. It's the same as shutting off your phone and turning it back on. There is no need to wipe data from the emulator after a cold boot unless it still has issues. Jun 18, 2019 at 12:56
  • 2
    This worked for me.. I tried different proxy , tried reboot, created different AVD.. Not sure why this worked.. but worked..!! Jul 25, 2019 at 16:39
179

I found a temporary solution on an old Stack Overflow thread at Upgraded to SDK 2.3 - now no emulators have connectivity. Note that this thread talks about Android SDK 2.3, not Android Studio 2.3. The problem seems to be that the emulator can't find the DNS my computer is currently using, and the temporary workaround is to start the emulator from the command line and specify the DNS server. Whatever problem occurred back then must have reappeared in the latest version of Android Studio.

The temporary solution outlined below fixes the problem with the emulator accessing the internet. However, it does not fix the problem that occurs when trying to run Android Device Monitor. Doing so will still make the emulator go offline as described above.

Note that there are two files named "emulator.exe" in the sdk -- one under sdk\tools and another under sdk\emulator. Either might work below, but I use the one under sdk\emulator.

The first step is to find where the SDK is located. Assuming a user name of "jdoe" and a default installation of Android Studio on Windows, the SDK is most likely in

C:\Users\jdoe\AppData\Local\Android\sdk

The second step is to determine the name of the AVD (emulator) that you want to run. The command

C:\Users\jdoe\AppData\Local\Android\sdk\emulator\emulator.exe -list-avds

will show the names of your AVDs. On my computer, it shows only one, Nexus_5X_API_25.

To start the emulator from the command line with a specified DNS server, use something like the following:

C:\Users\jdoe\AppData\Local\Android\sdk\emulator\emulator.exe -avd Nexus_5X_API_25 -dns-server 8.8.8.8

In this case, 8.8.8.8 is a Google public domain name server.

The above commands can be shortened if you create appropriate environment variables and edit your PATH environment variable, but I recommend caution when doing so.

11
  • This absolutely worked for me, but I wish there was a way to clean up the DNS outside the command line.
    – JaviCasa
    Jul 24, 2017 at 6:34
  • after paying 199$ license for windows pro to get Hyer-V and after discovering that the visual studio emulator doesn't support google_api_services, i found this solution that make the android emulator to connect internet... I feel like :|
    – Monah
    Dec 27, 2017 at 7:53
  • 2
    This totally works, but unbelievable this is still an issue with Android Studio 3.0 (emulator 27.1.12). Maybe related to having both wired and wireless network adapters in the system with wireless disabled? Mar 23, 2018 at 13:02
  • I filed a bug with Google and I hope they review the comments here and resolve whatever the underlying issue is.
    – paws
    Apr 20, 2018 at 15:26
  • 2
    Thanks! Mac OS: ~/Library/Android/sdk/emulator/emulator -avd Pixel_2_API_28 -dns-server 8.8.8.8
    – J. V.
    Apr 2, 2019 at 6:58
131

[UPDATE 2022] for Mac Users

For NOT Apple Silicon users

  1. System Preferences
  2. Network
  3. WiFi > Select Advanced
  4. From Advanced Choose DNS tab
  5. Add DNS Server 8.8.8.8
  6. Emulator must be restarted after DNS Server has been added (Thanks to @kapusch)

For Apple Silicon users

as per @bourdier-jonathan You can fix the Silicon issue here: Emulator appearing offline on M1 Mac after the last update of arm64-v8a

By replacing the AVD system images you have downloaded with the r02 images. Because It appears r03, r04, and r05 all don't work on m1

12
  • 11
    Good to know that emulator must be restarted after DNS Server has been added
    – Kapusch
    Dec 20, 2020 at 21:59
  • 1
    Also make sure that the 8.8.8.8 DNS Server is the first on the DNS Servers list. Jul 7, 2021 at 23:52
  • 3
    This solution is not working for me as of 8/24/2021 and using the 20201-3-1 release.
    – Jake
    Aug 14, 2021 at 3:53
  • 2
    This solution is not working on Apple silicon with the Android Studio Arctic Fox | 2020.3.1 macOS 11.4 Sep 15, 2021 at 16:29
  • 3
    Not working in AS Archtic fox, any other solution?
    – Nanda Z
    Sep 17, 2021 at 7:47
76

Updating my WIFI adapter to resolve DNS on 8.8.8.8 solved the issue for me. It started to happen after an Apple update which messed up the DNS address.

enter image description here

3
  • 18
    Don't forget to restart the emulator after making this change, as Ana Paula suggests.
    – Jordan
    Jul 26, 2018 at 16:31
  • 1
    See my comment above about using OpenDNS instead of Google. stackoverflow.com/questions/42736038/… Oct 11, 2018 at 16:59
  • Doesn't have to be 8.8.8.8 or OpenDNS, any working DNS server will work
    – sudo
    Nov 27, 2019 at 19:25
51

Simply open the AVD Manager and wipe the data of that emulator works for me.

3
  • 3
    It must of had my old wifi connection cached, because I moved to another wifi location and this issue started happening. I wiped the AVD and restarted and it picked up the wifi at the new location.
    – Mike Flynn
    Oct 2, 2018 at 13:27
  • After wipe data it failed to launch the emulator and shows the AVD was killed message
    – sejn
    Jul 31, 2020 at 6:08
  • It help me as well. Wipe data is working. Aug 12, 2021 at 11:32
44

Open Android emulator and go to the Extended Controls. Then go to the setting => proxy(Tab), uncheck "Use Android studio HTTP proxy setting" and click "Apply".

4
  • I on the other hand had to check it back again to make internet work. :(
    – Sankalp
    Aug 23, 2018 at 7:16
  • 2
    worked like a charm, but had to restart the emulator for it to pick up the setting.
    – u84six
    Jan 8, 2019 at 21:53
  • especially i had to make a cold boot after unchecking this option.
    – Hatzen
    Aug 3, 2021 at 21:46
  • Nice, it's working for me.
    – Amit raj
    Jan 18, 2022 at 6:25
42

macOS: long Story short.. make sure your DNS settings 8.8.8.8 is the first in line, wipe your data and do a cold boot.

enter image description here

5
  • 4
    This should be marked as the correct answer! Thanks a ton, man. You saved a lot of my time.
    – Ravi
    Feb 6, 2021 at 18:29
  • 3
    Thank you! Im not sure why I need to do this but it works now.
    – nilsi
    Apr 19, 2021 at 15:59
  • worked on my mac. should be marked as correct answer. By the way no need to wipe your data just in case Nov 6, 2021 at 3:25
  • I am on macOS. it works . Jan 12 at 9:49
  • 1
    No wipe was necessary for me, and worked like a charm, thanks mate. Mar 10 at 19:12
37

Reminder: the Android Emulator internet connection does not work if you turn on a VPN system on you computer.

7
  • 4
    I had this issue, it helps to boot the emulator with no VPN connections and only after it booted, connect to your VPN of choice
    – Pierre
    Oct 7, 2020 at 6:44
  • 1
    Yes it does for me. I just have to start emulator after VPN is connected.
    – DustinB
    Jul 15, 2021 at 4:36
  • If your VPN restricts use of emulator, start it in command line, see stackoverflow.com/a/42784657/2914140.
    – CoolMind
    Sep 15, 2021 at 14:51
  • 1
    Thanks, disabling the company VPN works...
    – Carra
    Jan 19, 2022 at 10:25
  • That was it. I had to do a cold boot to make it work too.
    – Geekarist
    Jan 28, 2022 at 8:17
30

I experienced this same issue after upgrade. Upon opening the Chrome browser in the emulator, google.com could no longer be reached.

I found a post on SO that suggested the problem was with the emulator trying to use a disconnected network adapter. For me the problem was occurring when I was connected to a LAN. Disabling the wireless LAN adapter fixed the issue.

To disable the adapter:

  1. Navigate to Network connections
  2. Find the adapter
  3. Right click and choose disable
3
  • 2
    Thanks for the tip. I was beginning to suspect something like this since I noticed that connecting via the wired LAN adapter also solved the problem. It should also be possible to fix this problem by changing the priority of the two adapters, but either way seems to be a drastic fix. Why can't Google simply fix the emulators to use the connection that my computer is using. As I said, this was not an issue before I upgraded to Android Studio 2.3. For now I will stick with the other solution where I specify the DNS server.
    – John Moore
    Mar 17, 2017 at 12:13
  • Thanks. I have LAN and wireless adapter. Working after disable wireless adapter.
    – Plugie
    Jul 22, 2017 at 9:28
  • Exactly! I have turned off all my PCs network adapters excluding my WiFi adapter and this worked. Thank you. Dec 29, 2017 at 22:19
30

I've resolved wiping data from AVD Manager

1
  • 4
    It works for me. I'm my case I was using emulator with API 22. After "Wipe Data" and "Cold Boot Now" the internet conection works fine, but I had to reinstall the app.
    – Akostha
    Oct 8, 2018 at 16:57
20

This happend to me when the emulator froze and I had to kill the process. The signal icon always showed the small "x" as in the screenshot and no internet connection was successful.

The only thing that helped was uninstalling and reinstalling the emulator (not the AVD images)

In Android Studio:

Tools-> Android -> SDK Manager Uncheck "Android Emulator" and let it uninstall then check again and let it install again.

Screenshot

7
  • 3
    Had the exact same problem, did this and the problem wasn't fixed. But after rebooting the whole computer the internet is now working on the emulator.
    – antogerva
    Jun 1, 2017 at 3:26
  • it's working for me, my situation .. reinstall android studio i used old my SDK files Jun 16, 2017 at 13:49
  • 6
    This is the only solution that worked for me (on a Mac fyi)
    – vikzilla
    May 2, 2018 at 21:52
  • Have to agree that this was the only solution also worked on a mac! Feb 25, 2020 at 2:37
  • I noticed that Android Emulator had an upgrade from 30.6.x to 30.7.5. I just upgraded it and everything suddenly started working for me. I tried all sorts of things such as the plethora of "DNS=8.8.8.8" suggestions and nothing worked except upgrading Android Emulator.
    – DustinB
    Jul 15, 2021 at 4:36
20

I am also facing the same problem, but I am trying to solve the problem using various posts. Today I discovered this problem. Your computer configuration is most likely the problemm, not Android Studio and the Android Emulator.

The problem is coming from your Network setup. Just set the Primary DNS Server to 8.8.8.8, which will solve the problem.

0
18

I got a simple and permanent solution for this issue in windows.

Go to network and internet option-> enter image description here

click on Etherenet or wifi(for which you are connected) option -> enter image description here

Click on change adapter option -> enter image description here

Right click on the network for which you have connected. enter image description here

A dialog box will be opened and just click on Internet protocal version (TCP/IPv4) option. enter image description here

Another dialog box will be opened and there just neglect the first set about the IP address (Keep as it is set) and click radio button of Use the following DNS server addresses: and enter as 8.8.8.8 in Preferred DNS server: and 8.8.4.4 in Alternate DNS server: enter image description here

Now you can open your emulator whenever and you will get internet in the android emulators.

2
  • 2
    None of the other solutions worked for me, but this one worked! As a mention: I'm on LAN cable, so I've made the changes on this setting instead of the Wifi connection. Jan 16, 2019 at 10:12
  • 1
    Thanks for the details in this comment.It helped me solve my problem.
    – Ekane 3
    Feb 22, 2021 at 15:30
10

For me the problem was caused when I took my laptop home without restarting the emulator. From what I have read, when the emulator starts up it reads your PC's DNS settings and uses them. When I was on my home network, my work DNS settings were failing.
So yeah. Just restarting the emulator solved my problem.

1
  • Simple and precise. It was my problem as well. Apr 25, 2022 at 3:56
9

This was a problem for me last time the emulator updated itself and back then disabling other network adapters fixed it. Now it's cropped up again but the only adapter that is enabled is a single wifi one so I have nothing to disable.

The issue only reappeared after I updated via a prompt the emulator tools to 26.1.1. I uninstalled and reinstalled the emulator via the SDK Tools update tab and thankfully the only option when installing again right now is to install 26.0.3 (which seems to be working okay).

Moral of the story is to be very wary of emulator updates.

2
  • Worked for me, had the exact same version, and after uninstalling, reinstalled 26.0.3. Jun 19, 2017 at 18:22
  • This solution worked for me too! I had to install 26.0.3 from Android Studio 2.3. though (the 3.0 preview only showed 26.1.1.). Thanks a lot! Jun 19, 2017 at 22:08
8

I faced this problem after i kept my emulator ON while going from my home to a cafe. "Cold Boot Now" fixed the issue.

7

After 10 days of trouble, I just deleted everything from C:\Android\.android\ and deleted all created AVDs. Now internet seems to work fine.

0
7

closing the emulator and reopening worked for me

OS WINDOWS 10

1
  • 2
    That worked for me. I have tried with restarting the virtual phone, but it was not enough. The issue might be triggered by allowing the running emulator through hibernate. Thanks. May 30, 2020 at 7:34
7

Just goto AVD manager and Cold Boot Now worked for me

7

I can make it work after turn off and turn on the wifi on android config

Turn on and off wifi

1
  • 1
    This worked for me. but you have to restart the emulator once May 18, 2021 at 12:12
6

Please go through the below link.

https://developer.android.com/studio/run/emulator-networking

Emulator open, click More ..., and then click Settings and Proxy. From here, you can define your own HTTP proxy settings.


Enter the hostname by following Run > cmd > hostname

Finally, check the internet access inside the emulator by browsing in chrome or google.

Note: Often wipe data will clear the issue. Please follow all steps

0
5

I am on android studio 3.1 and it happened. Solved it by restarting the adb server

$ adb kill-server
$ adb start-server

Hope it helps. Thank you

1
  • helped a lot thanks. i think sdk manager wasnt starting the server at all Apr 2, 2021 at 16:16
5

There was a problem for me too, by disabling the proxy in Android Studio settings, and run the emulator with "Cold Boot Now", the problem was resolved.

5

Solution for MacOS that does not use a custom DNS for your whole machine

Step 1

Locate the emulator executable Android Studio is using inside the Android SDK and rename it to emulator-original.

Mine is located /usr/local/share/android-sdk/emulator/emulator but it might vary based on individual setups.

Step 2

Add a new file called emulator in the place of the original file containing the following command (or using your DNS server of choice).

#!/bin/bash
$0-original "$@" -dns-server 8.8.8.8

Step 3

Make the new emulator file executable.

chmod +x emulator

Step 4

Restart the emulator using Android Studio.

4

if android browser can access internet you can run emulator from terminal by this command

go to SDK path then

$ /tools/emulator -avd Nexus_5X_API_23 -netdelay none -netspeed full

it solve your internet problem...

4

I was having the same issue and i resolved with below steps:-

Go to emulator setting and then go to

setting->Proxy->Either configure it Manually or use Tick use Android Studio HTTP proxy simulator.

please vote, if this works for you

0
4

Try these steps once, they worked for me:

  1. Disconnect your PC from the internet
  2. Close the emulator while you are still disconnected
  3. Again connect to the internet
  4. Finally start your emulator again
4

1-set no proxy

enter image description here

2-invalidate caches

enter image description here

3-remove old emulators and add new one

3

Just recreating the emulator with another target API worked for me

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.