android-emulator-m1-preview icon indicating copy to clipboard operation
android-emulator-m1-preview copied to clipboard

Apps that require internet connection does not work

Open obito2502 opened this issue 4 years ago • 17 comments

Hello everyone

I have project in android studio that has sign in functionality using firebase. When I run my app on emulator, I cannot use sign in, it says authentication failed. Does it mean that emulator has problems with internet connection or it means something else?

obito2502 avatar Dec 26 '20 19:12 obito2502

Are you using the latest release of the emulator with Google APIs support? Get it here: https://github.com/google/android-emulator-m1-preview/releases/tag/0.3

This can happen since Firebase itself relies on Google Services (com.google.gms:google-services:4.3.4') and the earlier versions of this M1 emulator did not have AVD images with those APIs included. Those have since been updated.

If your emulator is in fact running Google Services, try the following:

  1. Make sure you can access the internet - try navigating to a webpage in the WebView Browser Tester app
  2. In a terminal window, run adb logcat '*:E'. This will start capturing error logs from your device (make sure the emulator is connected to ADB). Then start your app with its Firebase integration and report the log output (remove personally identifying information).

ehamwey avatar Dec 27 '20 00:12 ehamwey

Are you using the latest release of the emulator with Google APIs support? Get it here: https://github.com/google/android-emulator-m1-preview/releases/tag/0.3

This can happen since Firebase itself relies on Google Services (com.google.gms:google-services:4.3.4') and the earlier versions of this M1 emulator did not have AVD images with those APIs included. Those have since been updated.

If your emulator is in fact running Google Services, try the following:

  1. Make sure you can access the internet - try navigating to a webpage in the WebView Browser Tester app
  2. In a terminal window, run adb logcat '*:E'. This will start capturing error logs from your device (make sure the emulator is connected to ADB). Then start your app with its Firebase integration and report the log output (remove personally identifying information).

Are you using the latest release of the emulator with Google APIs support? Get it here: https://github.com/google/android-emulator-m1-preview/releases/tag/0.3

This can happen since Firebase itself relies on Google Services (com.google.gms:google-services:4.3.4') and the earlier versions of this M1 emulator did not have AVD images with those APIs included. Those have since been updated.

If your emulator is in fact running Google Services, try the following:

  1. Make sure you can access the internet - try navigating to a webpage in the WebView Browser Tester app
  2. In a terminal window, run adb logcat '*:E'. This will start capturing error logs from your device (make sure the emulator is connected to ADB). Then start your app with its Firebase integration and report the log output (remove personally identifying information).

Thank you very much!

obito2502 avatar Dec 27 '20 12:12 obito2502

DNS requests fail with 0.3 Any idea what I did wrong?

WebView Browser reports: net:ERR_NAME_NOT_RESOLVED

2020-12-29 09:20:48.600 470-470/? E/netmgr: qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:network' service: Invalid argument 2020-12-29 09:20:48.600 470-470/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument 2020-12-29 09:20:48.656 472-472/? E/wifi_forwarder: qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:wififorward' service: Invalid argument 2020-12-29 09:20:48.656 472-472/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe

jonny7737 avatar Dec 29 '20 15:12 jonny7737

I am experiencing unstable network also, especially when the mac's network changes, the emulator seems to get disconnected until I restart it again.

hiroshihorie avatar Jan 01 '21 15:01 hiroshihorie

@HiroshiHorie that was an issue before M1 macs

radko93 avatar Jan 02 '21 21:01 radko93

is there any way to fix the connection? I'm in a similar situation as obito2502 no app inside the emulator could access the internet.

Madhawa97 avatar Jan 23 '21 23:01 Madhawa97

is there any way to fix the connection? I'm in a similar situation as obito2502 no app inside the emulator could access the internet.

Set mac's DNS to Google DNS (8.8.8.8) solved the connection issue for me.

HMKRL avatar Jan 26 '21 07:01 HMKRL

somehow I can't connect to the internet on my emulator v3. Is there any way to fix it?

bryanchau11 avatar Feb 16 '21 21:02 bryanchau11

Same here. @bryanchau11 is there a thread or something to discuss this matter? some say it works, some say it doesn't.

Madhawa97 avatar Feb 16 '21 22:02 Madhawa97

@Madhawa97 I can't find any.

bryanchau11 avatar Feb 16 '21 22:02 bryanchau11

Same here.. will try to find a solution

Androz2091 avatar Feb 17 '21 16:02 Androz2091

:warning: Changing my Mac's DNS to the Google ones worked for me! (8.8.8.8, 8.8.4.4) (restarting the emulator is necessarily)

Androz2091 avatar Feb 17 '21 16:02 Androz2091

I tried changing DNS to google's earlier as it was suggested but @HMKRL but it didn't work. Just now I also cleared two "userdata*.img" files located in /Applications/Android\ Emulator.app/Contents/MacOS/aosp-master-arm64-v8a/ then relauched the emulator. wahla! it works now. DNS change + restart doesn't enough. kudos to tiago7s from reddit. image

Madhawa97 avatar Feb 17 '21 17:02 Madhawa97

Is there a solution yet, because internet works on emulator v3 from github but not on arm64 builds from sdk manager.

srvraj311 avatar Aug 17 '21 00:08 srvraj311

same issue, internet connection exists on v3 from github releases but not on the emulator from sdk manager.

mehmetdelikaya avatar Aug 17 '21 10:08 mehmetdelikaya

is there any way to fix the connection? I'm in a similar situation as obito2502 no app inside the emulator could access the internet.

Set mac's DNS to Google DNS (8.8.8.8) solved the connection issue for me.

Thanks for the solution, It works like charm, I just need to restart my emulator after changing the DNS settings

prince-housing avatar May 18 '22 05:05 prince-housing

I'm seeing these logs when running android emulator on the CI using Github Actions.

Sample:

07-13 09:59:20.348   504   504 E netmgr  : qemu_pipe_open_ns:62: Could not connect to the 'pipe:qemud:network' service: Invalid argument
07-13 09:59:20.349   504   504 E netmgr  : Failed to open QEMU pipe 'qemud:network': Invalid argument

I'm wondering if anyone has experienced this issue and/or knows how to set the Github Action environment (we run on either macos-latest or ubuntu-latest) as below noted?

is there any way to fix the connection? I'm in a similar situation as obito2502 no app inside the emulator could access the internet.

Set mac's DNS to Google DNS (8.8.8.8) solved the connection issue for me.

Not running on m1 of course, but thought I'd put it out there in case anyone had done something similar with their CI.

russellwheatley avatar Jul 13 '22 13:07 russellwheatley