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浏览器是否可以访问Internet 你可以从终端运行模拟器 通过此命令

然后进入SDK路径

$ /工具/ avd模拟器 下一个是5x_api_23 -netdelay no -netspeed full

它解决了你的网络问题…

其他回答

我也有这个,我通过创建新的android模拟器虚拟设备解决了这个问题,并选择了Nexus 4 api 27。在我创建Pixel设备api 28之前,即使在重新创建设备后,它也无法工作。所以我尝试了完全不同的配置和Android模拟器有互联网连接的预期。其他的解决方案对我来说都不奏效,但我并没有尝试所有的方法。

也许你为Android Studio设置了代理,但代理不起作用。尝试没有代理。

在最新的Mac与Jio IP6配置问题,它阻止互联网上的android模拟器,所以从android虚拟设备管理器模拟器列表操作列下拉选择选项“冷启动现在”修复了这个问题。我面对这个问题后,我保持不变,它为我工作。

去你的适配器设置,将DNS更改为8.8.8.8,也就是谷歌,它会工作,它对我来说很有效

我在升级到SDK 2.3的旧Stack Overflow线程上找到了一个临时解决方案-现在没有模拟器具有连接性。注意,本文讨论的是Android SDK 2.3,而不是Android Studio 2.3。问题似乎是模拟器无法找到我的计算机当前正在使用的DNS,临时的解决方法是从命令行启动模拟器并指定DNS服务器。无论当时发生了什么问题,一定会在最新版本的Android Studio中重新出现。

下面概述的临时解决方案修复了模拟器访问internet的问题。但是,它并没有修复试图运行Android设备监视器时发生的问题。这样做仍然会使模拟器脱机,如上所述。

注意,在sdk中有两个名为“模拟器.exe”的文件——一个在sdk\tools下,另一个在sdk\emulator下。任何一个都可能在下面工作,但我使用sdk\emulator下的一个。

第一步是找到SDK的位置。假设用户名为“jdoe”,并且在Windows上默认安装了Android Studio,那么SDK很可能在

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

第二步是确定要运行的AVD(模拟器)的名称。命令

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

将显示avd的名称。在我的计算机上,它只显示了一个,Nexus_5X_API_25。

要使用指定的DNS服务器从命令行启动模拟器,可以使用如下命令:

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

在此例中,8.8.8.8为谷歌公共域名服务器。

如果创建适当的环境变量并编辑PATH环境变量,则可以缩短上面的命令,但我建议在这样做时要谨慎。