google / android-emulator-container-scripts

1.82k stars 256 forks source link

Emulator shows only the status:connecting, and after some Minutes disconnect with (gRPC low level error: Http response at 400 or 500 level ) #362

Closed nahshal closed 7 months ago

nahshal commented 8 months ago

Hallo Team,

following the steps here: https://source.android.com/docs/automotive/start/avd/cloud_emulator I have tried to install the Emulator on a GCP VM with Ubuntu 22, that supports nested Virtualization. and made sure that http/https firewall is allowed for the Instance. the emulator and system image used is following:

I could get the Emulator running and I could also sign in with firebase, but after signing in, I see nothing but the status:connecting and after some Minutes the status is turned to disconnected with the following Error: Low level gRPC error: {"message":"Http response at 400 or 500 level).

Bildschirmfoto 2023-10-25 um 11 22 11

Bildschirmfoto 2023-10-25 um 16 13 10

another Problem, I can only reach the Emulator with http:// but not with https://

I have tried also to activate turn and everything I found on the Internet, without any Success. By the way, I have not changed any configuration, the only thing I changed is the firebase configuration.

nahshal commented 7 months ago

I have solved my Issue, in case any one facing the same Problem:

I have changed the source code of the envoy.yaml to work with https, so I generated new Certificate and uploaded them unter js/docker/cert and then copy them into the project inside the envoy.Dockerfile. In addition to that, you need to update the firebase configuration in js/firebase.config to match your firebase project settings.

I also changed the port in envoy.yaml to use 8443 in the sametime, changed this in envoy.Docker and more important in js/src/Apps.js, it is hard coded there with 8080, change it to 8443. Of course, here you would need to allow traffic from VM for https with port 8443

after that the Emulator was connected and working for png but not showing any video (webRTC). so then follow the Doc to enable the COTURN server and do not forget to allow the UDP traffic from your VM for the turn port that you configured.

and then it should work.

nahshal commented 7 months ago

The Configuration you have written is not clear and there is a lot of info missing or not updated.

ajaysagar99 commented 7 months ago

@nahshal - I need some help with setting this up, I am unable to signin after doing all the configuration. It will be of great help if you can spare some time

nahshal commented 7 months ago

@ajaysagar99, you need to check 3 places,

  1. first create new project on firebase and then copy the configuration from setting.
  2. Edit the file js/firebase.config in the Emulator Project and add your configuration.
  3. in your GCP Account, you need to edit the firebase configuration to match the firebase configuration.
ajaysagar99 commented 7 months ago

@nahshal - Can you please elaborate more on how you did step 3?

nahshal commented 7 months ago

@ajaysagar99,

In your GCP account, go to Credentials, you will find OAuth 2.0 Client IDs. Web client (auto created by Google Service, go inside and then make sure you insert your URLs inside the Authorised JavaScript origins something like

URIs 1: https://.firebaseapp.com URIs 2: https://

also make sure that under API keys -->. Set an application restriction Websites (checked)

ajaysagar99 commented 7 months ago

@nahshal - Thank you very much! Mine opens in HTTP though and not HTTPS - not sure why

ajaysagar99 commented 6 months ago

@nahshal - I followed the steps and configured the turn server but I don't see any video.

Did you find any issues in the documentation?