ca9163d9
ca9163d9

Reputation: 29179

The WebView running in the emulator in Android studio cannot access internet, but Chrome can?

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.

Upvotes: 9

Views: 33813

Answers (5)

It may be a bit late, but my solution was to add the port to the address: https://www.XXXXX.com:443

Upvotes: 0

Ibragim Khavaev
Ibragim Khavaev

Reputation: 31

It may be a bit late, but still. You have to make sure that you included ALL the following permissions.

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Upvotes: 3

Eugene Gr. Philippov
Eugene Gr. Philippov

Reputation: 2092

Sometimes, you need to connect to your VPN provider to get rid of net::ERR_NAME_NOT_RESOLVED error. This is unrelated to the host VPN connection for the host computer if you're at some emulator. You need VPN at the emulator's Android, too.

Upvotes: 1

Sum None
Sum None

Reputation: 2279

This may sound kind of obvious, but make sure 3G is turned on in your emulator:enter image description here

To do so, turn on Cellular Data (on is the switch to the right):

enter image description here

Then notice the 3G symbol shows up above the signal strength symbol: enter image description here

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.

Upvotes: 10

Pankaj Kumar Katiyar
Pankaj Kumar Katiyar

Reputation: 1494

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.

Upvotes: 0

Related Questions