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模拟器V 7.1.1中遇到了同样的网络连接问题,然后我在我的android模拟器中将android版本降低到7.1.1以下,然后它的工作正常。

其他回答

专业提示:在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

我可以让它在关机后工作,并在android配置上打开wifi

一套无代理

2-invalidate缓存

3 .删除旧的模拟器并添加新的

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

$ adb kill-server
$ adb start-server

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

我观察到的是,当你切换wifi连接时,android模拟器正在运行。它无法连接到新的wifi。

一个简单的解决方案是重新启动android模拟器。