Android Emulator SDK cannot access internet - web

2020-04-17 06:41发布

问题:

I've been having issues with Android Emulator SDK It's actually occurring on all versions and resolutions. The error I'm having is URLs cannot be resolved by the DNS. If I type in the IP Address for, say, Google, it works. It's definitely a DNS issue. I am using the Android Virtual Device Manager; I am NOT using Eclipse, Netbeans, or some other IDE for testing. Is there a way to resolve this through the AVDM GUI, perhaps utilizing the Hardware Property/Value pairs?

Thank you very much.

回答1:

same issue is happening with me so i tried below command inside to

~/Android/Sdk/tools

emulator -avd Nexus_5X_API_25 -dns-server 8.8.8.8


回答2:

I could not find any option in the GUI to set the DNS. This must be a bug with the emulator itself. The only way I could fix it is run the emulator from the command-line-interface, i.e.

android @avd_name -dns-server x.x.x.x,x.x.x.x

You can set up to 4 dns server entries and there shouldn't be any spaces between dns entries.



回答3:

Actually, I found a better answer. The problem was resolved when I changed the nic adpater binding order. I don't know why this was an issue, since I did not touch the binding order at any time, since working with the Android Emulator SDK.

I'm running a windows dev box; so, for those users, goto Control Panel -> Network Connections -> Advanced -> Advanced Settings -> Adapters and Binders -> Connections.

(source: http://forums.techarena.in/networking-security/1396635.htm).