问题
I installed Android studio 1.0.1 and followed this page https://developer.chrome.com/multidevice/webview/gettingstarted to wrap a website to an app.
However, I got the following error when running it in emulator.
Webpage not available
The webpage at https://..... could not be loaded because:
net::ERR_NAME_NOT_RESOLVED
However, I tried to click the link and it launched the website in Chrome without any problem.
回答1:
This may sound kind of obvious, but make sure 3G is turned on in your emulator:
To do so, turn on Cellular Data (on is the switch to the right):
Then notice the 3G symbol shows up above the signal strength symbol:
I've been trying to manage connection state and stumbled onto this question and know that's a possible reason for that error. It's a little late, but hopefully helps someone down the line.
回答2:
Provided you've given access to internet in manifest.xml, and still emulator can't access internet, this solution worked for me on windows 7:
Click Start -->Run, type in cmd, press OK. Copy and paste this into the Command prompt: netsh winsock reset catalog Press Enter Then copy and paste this in: netsh int ip reset reset.log Press Enter. When finished restart your computer.
来源:https://stackoverflow.com/questions/27740296/the-webview-running-in-the-emulator-in-android-studio-cannot-access-internet-bu