google / android-emulator-m1-preview

Apache License 2.0
1.83k stars 161 forks source link

Apps that require internet connection does not work #4

Open obito2502 opened 3 years ago

obito2502 commented 3 years ago

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?

ehamwey commented 3 years ago

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).
obito2502 commented 3 years ago

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!

jonny7737 commented 3 years ago

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

hiroshihorie commented 3 years ago

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

radko93 commented 3 years ago

@HiroshiHorie that was an issue before M1 macs

Madhawa97 commented 3 years ago

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.

HMKRL commented 3 years ago

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.

bryanchau11 commented 3 years ago

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

Madhawa97 commented 3 years ago

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

bryanchau11 commented 3 years ago

@Madhawa97 I can't find any.

Androz2091 commented 3 years ago

Same here.. will try to find a solution

Androz2091 commented 3 years ago

: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)

Madhawa97 commented 3 years ago

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

srvraj311 commented 3 years ago

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

mehmetdelikaya commented 3 years ago

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

prince-housing commented 2 years ago

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

russellwheatley commented 2 years ago

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.