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


当前回答

在尝试了许多这些解决方案之后,我打算删除我当前的AVD并重新制作它,但当我点击AVD上的向下箭头时,我注意到“现在冷启动”。

一时兴起,我试了一下。瞧,我的模拟器又有互联网连接了!

命令行方式

如果你通过命令启动模拟器,传递-no-snapshot-load选项,比如:

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

或者MacOSX:

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

注意,您可能需要更改-avd Pixel_2_API_28部分(与您自己的虚拟设备名称)。 此外,大多数工具使用ANDROID_HOME环境变量名,因此定义它(如果还没有),但现在ANDROID_ROOT是另一个命名选项。

决定(编辑)

对于那些说为什么不擦除数据重新启动的人。 你每次重启电脑时都重新格式化吗?擦除模拟器上的数据就像对手机进行出厂重置或重新格式化PC上的硬盘驱动器并重新安装操作系统。除非数据完全损坏,否则这是不必要的。

当你关闭模拟器并重新启动它时,它就像将你的电脑置于休眠或睡眠模式。记忆不是被抹去,而是被保存。

冷启动和重启手机或电脑是一样的。它可以重置内存并重新加载。这允许网络模拟以干净的内存启动并正确连接。

所以,不要擦除数据。只是冷启动。如果还是没用,那就擦一下,但要留作最后的手段。

其他回答

这发生在我身上时,模拟器冻结,我必须杀死进程。信号图标总是显示屏幕截图中的小“x”,没有网络连接成功。

唯一有帮助的是卸载和重新安装模拟器(不是AVD图像)

在Android Studio中:

工具-> Android -> SDK管理器 取消选中“Android模拟器”,让它卸载,然后再次检查,让它重新安装。

我有同样的问题,我解决了以下步骤:-

转到模拟器设置,然后转到

设置->代理->手动配置或使用Tick使用Android Studio HTTP代理模拟器。

请投票,如果这对你有用的话

我有visual studio 2017,这简单的几次点击已经修复了Android模拟器的互联网问题。

我在Windows 10上也遇到了同样的问题。我刚刚进入网络和互联网设置>更改适配器选项>右键单击Wi-Fi并选择属性>在列表中选择internet协议版本4并单击属性>打开“使用以下DNS服务器地址”并填写第一部分“8.8.8.8”地址。 问题解决了!

Android 9+模拟器适合我,但Android 7不能连接到互联网。

我办公室用的是小飞贼应用防火墙。我把它关掉了,Android 7运行正常。检查一下防火墙可能是个好主意。