https://kotlinlang.org logo
Title
j

jmfayard

02/24/2020, 10:43 AM
My Android emulator has no internet on a macOS that has internet. I have no idea how to investigate or what do do? Any idea? cause this is making me mad 🙂 Edit: after using Google DNS and wiping out the data and updating everything, the internet started to work again but I don't know why
f

Francisco Javier Ruiz Rodriguez

02/24/2020, 10:45 AM
Are you under a proxy or something similar?
j

jmfayard

02/24/2020, 10:46 AM
Nope
f

Francisco Javier Ruiz Rodriguez

02/24/2020, 10:48 AM
Have you checked the cellular options in the 3 dots menu of emulator?
j

jmfayard

02/24/2020, 10:48 AM
My home wifi has issues that I should probably fix. Is the Android emulator connecting to the internet directly via wifi or is it using the macOS internet connection?
a

Alishen

02/24/2020, 10:50 AM
You might have some DNS issues. Try to flush your DNS or assign custom DNS
👆 1
f

Francisco Javier Ruiz Rodriguez

02/24/2020, 10:52 AM
I have checked my emulator, and the wifi is disconnected, just using data
I think emulator use your OS internet connection by default
j

jmfayard

02/24/2020, 10:58 AM
after using Google DNS and wiping out the data and updating everything, the internet started to work again but I don't know why
👍 1
the emulator is very slow though but I guess that's normal
w

wasyl

02/24/2020, 10:59 AM
I used to have this issue after setting up custom DNS servers on my mac. I had to either set up Google’s (or other) DNS servers explicitly in emulator settings, I recall running it with
emulator -avd Pixel_2_API_28 -dns-server 1.1.1.1
the emulator is very slow though but I guess that’s normal
Depending how slow, but I wouldn’t say it’s normal. Emulator is pretty fast now in all aspects
Make sure you have HAXM installed and that you enabled kernel extension in settings -> security after that (
kextstat | grep intel
in terminal yields two entries for me)
👍 1
a

Alessandro Mautone

02/24/2020, 11:01 AM
I have a similar issue when connecting to my VPN while the emulator is running. Usually rebooting the emulator solves the issue 😅
j

jmfayard

02/24/2020, 11:03 AM
Thanks for the tip,
$ kextstat
gives me intelhaxm. Any way it's quick enough that I can work with this
172    0 0xffffff7f84fb3000 0x29000    0x29000    com.intel.kext.intelhaxm (7.5.1) D0CC7B8F-1F62-33B1-BE6B-B5573D2A607B <8 6 5 3 1>
👍 1
w

wasyl

02/24/2020, 11:18 AM
That should be fine then. You can also verify in AVD Manager that for that emulator you have hardware graphics emulation, perhaps multi-core CPU if your mac allows, and reasonable RAM. And use recommended images, it should be pretty fast (specifically later emulators, like API 28/29)
a

Alishen

02/24/2020, 11:37 AM
Nexus 6 has the hardware graphics option
m

mpcjanssen

02/24/2020, 12:32 PM
I have this issue after the laptop was suspended. Restarting the emulator usually fixes it for me (wiping data is not needed)
s

Samuel Michael

03/12/2020, 4:52 AM
That is quite common for android, I would recommend deleting that avd and creating a new one and don’t get too stuck trying to debug it’s not worth the stress!