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


当前回答

MacOS解决方案,不为整个机器使用自定义DNS

步骤1

找到Android Studio在Android SDK中使用的模拟器可执行文件,并将其重命名为simulator -original。

我的位于/usr/local/share/android-sdk/emulator/emulator,但它可能会根据个人设置而有所不同。

步骤2

在包含以下命令的原始文件(或使用您选择的DNS服务器)的位置添加一个名为emulator的新文件。

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

步骤3

使新的模拟器文件可执行。

chmod +x emulator

步骤4

使用Android Studio重新启动模拟器。

其他回答

提醒:如果您打开计算机上的VPN系统,Android模拟器的互联网连接将无法工作。

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

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

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

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

一套无代理

2-invalidate缓存

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

我也面临着同样的问题,但我试图通过各种帖子来解决这个问题。今天我发现了这个问题。问题很可能出在你的电脑配置上,而不是Android Studio和Android模拟器。

问题来自您的网络设置。只要将主DNS服务器设置为8.8.8.8,就可以解决问题。

只需要用另一个目标API重新创建模拟器就可以了