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".


当前回答

我使用的是android studio 3.1,它就发生了。 通过重新启动adb服务器解决了这个问题

$ adb kill-server
$ adb start-server

希望能有所帮助。谢谢你!

其他回答

对我来说,问题是我的电脑连接了VPN。一旦我断开连接,它开始在模拟器中工作。

专业提示:在Linux上使用AVD和dnsmasq

要理解你,请阅读从Android Studio设置Android模拟器网络。

被模拟设备的环回为127.0.0.1,可以从10.0.2.2访问被模拟设备的主机环回。

在启动时,模拟设备通过从/etc/resolv.conf中的主机中选择DNS名称服务器来设置它的DNS名称服务器。

但重点是,如果你正在使用dnsmasq,你setnameserver 127.0.0.1in/etc/resolv.conf ',所以模拟设备将击中它自己的环回,那里没有任何运行,而不是主机环回,那里有一个DNS服务器运行。

在命令行下运行AVD时,需要添加-dns-server。

例如:

云耀斑DNS: ~/Android/Sdk/模拟器- avdk_nexus_9_api_23 - DNS -服务器1.1.1 主机dnsmasq: ~/Android/Sdk/模拟器- avdd Nexus_9_API_23 -dns-服务器1.0.2.2

请点击下面的链接。

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

打开模拟器,点击更多…,然后单击“设置和代理”。从这里,您可以定义自己的HTTP代理设置。

输入主机名 执行> cmd > hostname

最后,通过chrome浏览器或谷歌检查模拟器内部的网络访问。

注意:经常擦数据就会清除这个问题。请遵循所有步骤

macOS:长话短说…确保你的DNS设置8.8.8.8是第一个,擦除你的数据并进行冷启动。

关闭模拟器并重新打开对我来说很有效

OS WINDOWS 10