4

It's been a while since I opened android studio. It's all good until today. Today the android emulator can't connect to the internet (tried with chrome browser and my application in the emulator), altough it's wifi is connected. How to fix this?

I already tried:

  • your_path_of_android_sdk\tools\emulator -avd -dns-server 8.8.8.8, but failed with message: PANIC: Missing emulator engine program for 'x86'
  • remove emulator, and add a new one from AVD manager
  • restart pc
  • reinstall android studio

emulator wifi settings (auto ip / dhcp): Nexus 5S Api 28

  • ip address: 192.168.232.2
  • gateway: 192.168.232.1
  • subnetmask: 255.255.248.0
  • dns: 10.0.2.3

Is there a possibility I accidentally uninstall something important / removing network adapter in the 'Control Panel\Network and Internet\Network Connections' ? ( there is only one adapter in there )

Images:

aryono
  • 121
  • 1
  • 1
  • 8
  • Possible duplicate of [Android Studio - Android Emulator wifi connected with no internet](https://stackoverflow.com/questions/50670547/android-studio-android-emulator-wifi-connected-with-no-internet) – Raman Sahasi Jul 11 '19 at 16:36

2 Answers2

7

Just found the solution

your_path_of_android_sdk\tools\emulator -avd -dns-server 8.8.8.8, but failed with message: PANIC: Missing emulator engine program for 'x86'

it does work! but i have to use emulator.exe in the "emulator" folder, not the one in the "tools" folder

the complete command is: F:\AndroidSDK\emulator>emulator -avd Nexus_5X_API_28_x86 -dns-server 8.8.8.8

where Nexus_5X_API_28_x86 is my android emulator name (found in the avd manager in the android studio).

aryono
  • 121
  • 1
  • 1
  • 8
3

I was facing the same problem. So while using emulator in outside network it was working and then at my home network, same emulator was showing no internet. The possible cause is due to DNS.

But the solution I opted for this issue is to start emulator, turn off Wi-Fi and turn off data connection of emulator. And then turn on both again and see it will get connected to Internet eventually.

Ankit Gupta
  • 674
  • 1
  • 6
  • 17