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".
当前回答
Mac用户[UPDATE 2022
针对的不是苹果芯片用户
系统设置 网络 WiFi >选择“高级” 从高级选择DNS选项卡 添加DNS服务器8.8.8.8 模拟器必须在添加DNS服务器后重新启动(感谢@kapusch)
苹果硅用户
@bourdier-jonathan 你可以在这里修复硅的问题: 在arm64-v8a最后一次更新后,模拟器在M1 Mac上出现脱机
通过将您下载的AVD系统映像替换为r02映像。因为r03 r04 r05在m1上都不起作用
其他回答
我在android模拟器V 7.1.1中遇到了同样的网络连接问题,然后我在我的android模拟器中将android版本降低到7.1.1以下,然后它的工作正常。
经过10天的麻烦,我刚刚删除了C:\Android\中的所有内容。并且删除了所有创建的avd。现在互联网似乎工作得很好。
我有同样的问题,我解决了以下步骤:-
转到模拟器设置,然后转到
设置->代理->手动配置或使用Tick使用Android Studio HTTP代理模拟器。
请投票,如果这对你有用的话
提醒:如果您打开计算机上的VPN系统,Android模拟器的互联网连接将无法工作。
窗户 在所选网络连接的“TCP/IP属性”窗口中指定DNS设置。
举例:在Windows 10操作系统下修改DNS服务器设置
进入控制面板。 单击“网络和Internet”>网络和共享中心>更改适配器设置。 选择需要配置谷歌Public DNS的连接。例如:
要更改以太网连接的设置,右键单击以太网接口,选择“属性”。 要更改无线连接的设置,右键单击Wi-Fi界面并选择属性。 如果系统提示您输入管理员密码或确认,请键入密码或提供确认信息。
选择Networking选项卡。在“此连接使用以下项目”下,选择“Internet协议版本4 (TCP/IPv4)”或“Internet协议版本6 (TCP/IPv6)”,然后单击“属性”。
单击“高级”,选择“DNS”页签。如果那里列出了任何DNS服务器IP地址,请将它们写下来以备将来参考,并将它们从这个窗口中删除。
单击OK。
勾选“使用以下DNS服务器地址”。如果“首选DNS服务器”或“备选DNS服务器”中存在IP地址,请将其记录下来,以便后续查询。
替换为谷歌DNS服务器的IP地址。
对于IPv4: 8.8.8.8和/或8.8.4.4。 IPv6: 2001:4860:4860::8888和/或2001:4860:4860::8844。 仅IPv6:您可以使用谷歌Public DNS64代替前面提到的IPv6地址。 测试你的设置是否正常工作;请参见测试您的新设置。
对要更改的其他网络连接重复此过程。
macOS DNS设置在“网络”窗口中指定。
举例:在macOS 10.15操作系统下修改DNS服务器设置
Click Apple menu > System Preferences > Network. If the lock icon in the lower left-hand corner of the window is locked, click the icon to make changes, and when prompted to authenticate, enter your password. Select the connection for which you want to configure Google Public DNS. For example: To change the settings for a Wi-Fi connection, select Wi-Fi, and click Advanced. To change the settings for an Ethernet connection, select Built-In Ethernet, and click Advanced. Select the DNS tab. Click + to replace any listed addresses with, or add, the Google IP addresses at the top of the list: For IPv4: 8.8.8.8 and/or 8.8.4.4. For IPv6: 2001:4860:4860::8888 and/or 2001:4860:4860::8844. For IPv6-only: you can use Google Public DNS64 instead of the IPv6 addresses in the previous point. Click OK > Apply. Test that your setup is working correctly; see Test your new settings. Repeat the procedure for additional network connections you want to change.
Linux 在大多数现代Linux发行版中,DNS设置都是通过网络管理器配置的。
举例:修改Ubuntu的DNS服务器设置
Click System > Preferences > Network Connections. Select the connection for which you want to configure Google Public DNS. For example: To change the settings for an Ethernet connection, select the Wired tab, then select your network interface in the list. It is usually called eth0. To change the settings for a wireless connection, select the Wireless tab, then select the appropriate wireless network. Click Edit, and in the window that appears, select the IPv4 Settings or IPv6 Settings tab. If the selected method is Automatic (DHCP), open the dropdown and select Automatic (DHCP) addresses only instead. If the method is set to something else, do not change it. In the DNS servers field, enter the Google Public DNS IP addresses, separated by a comma: For IPv4: 8.8.8.8 and/or 8.8.4.4. For IPv6: 2001:4860:4860::8888 and/or 2001:4860:4860::8844. For IPv6-only: you can use Google Public DNS64 instead of the IPv6 addresses in the previous point. Click Apply to save the change. If you are prompted for a password or confirmation, type the password or provide confirmation. Test that your setup is working correctly; see Test your new settings. Repeat the procedure for additional network connections you want to change. If your distribution doesn't use Network Manager, your DNS settings are specified in /etc/resolv.conf.
举例:在Debian服务器上修改DNS服务器设置 编辑/etc/resolv.conf:
sudo vi /etc/resolv.conf
如果出现任何命名服务器行,请写下IP地址以备将来参考。
用或添加以下行替换命名服务器行:
IPv4:
nameserver 8.8.8.8
nameserver 8.8.4.4
For IPv6:
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844
对于IPv6,可以使用谷歌Public DNS64代替上述IPv6地址。
保存并退出。
重新启动您正在使用的任何Internet客户机。
测试你的设置是否正常工作;请参见测试您的新设置。
推荐文章
- 如何隐藏动作栏之前的活动被创建,然后再显示它?
- 是否有一种方法以编程方式滚动滚动视图到特定的编辑文本?
- 在Android中将字符串转换为Uri
- 如何在NestedScrollView内使用RecyclerView ?
- 移动到另一个EditText时,软键盘下一步点击Android
- Android应用中的GridView VS GridLayout
- Activity和FragmentActivity的区别
- 右对齐文本在android TextView
- 权限拒绝:start前台需要android.permission.FOREGROUND_SERVICE
- 如何更改android操作栏的标题和图标
- Android Split字符串
- 让一个链接在安卓浏览器启动我的应用程序?
- 如何在Android工作室的外部库中添加一个jar ?
- GridLayout(不是GridView)如何均匀地拉伸所有子元素
- 如何让一个片段删除自己,即它的等效完成()?