Android emulator not able to access the internet

2019-01-16 06:01发布

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". emulator with error message

28条回答
疯言疯语
2楼-- · 2019-01-16 06:47

Updating my WIFI adapter to resolve DNS on 8.8.8.8 solved the issue for me. It started to happen after an Apple update which messed up the DNS address.

enter image description here

查看更多
来,给爷笑一个
3楼-- · 2019-01-16 06:48

I solved this after 8 or 9 days. Just uninstall android emulator SDK(from SDK manager) and then reinstall android emulator SDK. in 8 or 9 days i tried :

1.new windows setup
2.uninstall and install android studio
3.change windows sharing setting
4.change DNS server addresses
5.delete and create some AVDs
6.delete .android folder and create new one etc.
查看更多
Viruses.
4楼-- · 2019-01-16 06:50

I've faced the very and suddenly same problem on my MAC. After having tried everything, I've finally deleted the folder /Users/Philippe/.android and create a new emulator.

查看更多
ら.Afraid
5楼-- · 2019-01-16 06:51

Simply open the AVD Manager and wipe the data of that emulator works for me.

查看更多
迷人小祖宗
6楼-- · 2019-01-16 06:51

Pro tips: using AVD with dnsmasq on Linux

To understand you to read Set up Android Emulator networking from Android Studio.

The loopback of the emulated device is 127.0.0.1 and the host loopback can be accessed from the emulated device from 10.0.2.2.

At startup, the emulated device set its DNS nameserver by picking those from the host in /etc/resolv.conf.

But the point is, if you are using dnsmasq, you setnameserver 127.0.0.1in/etc/resolv.conf` so the emulated device will hit it's own loopback where nothing is running instead of the host loopback where there is a DNS server running.

To solve that, add -dns-server when running AVD from the CLI.

For example:

  • Cloudflare DNS: ~/Android/Sdk/emulator/emulator -avd Nexus_9_API_23 -dns-server 1.1.1.1
  • Host's dnsmasq: ~/Android/Sdk/emulator/emulator -avd Nexus_9_API_23 -dns-server 1.0.2.2
查看更多
该账号已被封号
7楼-- · 2019-01-16 06:52

I've resolved wiping data from AVD Manager

查看更多
登录 后发表回答