Android Emulator - Wifi Error

2020-07-06 04:19发布

问题:

I am using the Android SDK Emulator ad trying to connect to the web. I can not do it as in the settings > Wireless & Networks , Where i need to turn the WiFi On, i get "Error"

How to solve it?

Gorov

回答1:

  1. Shut down the emulator.
  2. Turn off Ethernet, Firewire, and any other network interfaces. All of them. And I mean completely shut them off, e.g. on a Mac, open System Preferences > Network > Ethernet > Configure > OFF. Simply unplugging the Ethernet cable is not enough.
  3. Enable Wifi and verify it works.
  4. Launch the Android emulator.

It should now display a 3G icon (or similar) in the status bar, and you should be now able to surf the web.



回答2:

Look at Controlling the Emulator.

Press F8 in the emulator, this should enable your data connection. It's weird, sometimes the connection is disabled when you start up the Emulator.

Regards



回答3:

As stated in Enabling Wifi on Android Emulator and Android: Simulate WiFi in the emulator?, this simply isn't supported in the emulator. If you want wifi, you need a real device.

As other people in this question have stated, you can access the internet in general: whether your computer is using a wired or wireless network, it's possible to configure your emulator's "3G" or "4G" to pull the network from the host machine. But the emulator-internal "WiFi" can't work correctly.

(this question is probably a duplicate. Even the later of the two questions I referenced is almost a duplicate of the other)



回答4:

I think, sometimes emulator wont connect to internet if you start the emulator after connecting your internet connection to the computer... try connecting the internet first and then starting the emulator....



回答5:

I made a factory reset in VS in manage android devices and after that emulator was connected to wifi!



回答6:

You shouldn't need to "turn on" the wifi of the AVD. It should work using your computers internet connection. Here is what worked for me when wifi on my AVD stops working(I needed to reset my AVD):

  • Close AVD and confirm it is not running
  • Open AVD Manager in Android Studio (Tools > AVD Manager)
  • Click on the dropdown arrow on the right side of the emulator
  • Click "Wipe Data"
  • Confirm the internet on your computer is working then re-launch AVD

This issue recurs for me sometimes but after I complete the above steps it works again.



回答7:

I have also encountered this problem when I was using Win7. I had to switch to a wired connection as nothing seemed to be working.

F8 is indeed the key to turn network on/off, but it just didn't work for me.

I later switched to Ubuntu, but didn't test whether emulator works with wifi on Ubuntu.



回答8:

What worked for me was to unplug my ethernet lan cable and enable my Wi-FI connection. Seems it was mixing both.

My computer uses MAC and I was working with Eclipse.



回答9:

You can't switch the Wi-Fi ON in the emulator. This is a particularly tricky issue when working behind a firewall or a proxy.

In some cases, however, using only ONE of ethernet or Wi-Fi might help.

But you can connect to the internet through the emulator if you can configure the APNs properly.