presentation-displays icon indicating copy to clipboard operation
presentation-displays copied to clipboard

Error in emulator when opening the second display

Open joranmulderij opened this issue 2 years ago • 3 comments

I got this error:

E/flutter ( 4259): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter ( 4259): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:177:18)
E/flutter ( 4259): <asynchronous suspension> 

when running on an android emulator. I tested multiple emulator devices, but they all gave the same error.

To Reproduce Steps to reproduce the behavior:

  1. Run Pixel C api 30 android emulator
  2. Add a second display.
  3. Launch the example app
  4. Click "Get Displays"
  5. Put the ID for the second display into the textbox
  6. Click show presentation
  7. Look at the console

Expected behavior The second display should show something.

Smartphone:

  • Device: Pixel C
  • OS: Android api 30

joranmulderij avatar Mar 16 '22 16:03 joranmulderij

I am getting the exact same Exception:

I/ContentValues( 2962): Channel: method: showPresentation | arguments: {"displayId": 2,"routerName": "presentation"}
I/ContentValues( 2962): Channel: method: showPresentation | displayId: 2 | routerName: presentation
E/flutter ( 2962): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(showPresentation, Unable to add window android.view.ViewRootImpl$W@379a897 -- the specified display can not be found, null, null)
E/flutter ( 2962): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter ( 2962): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:177:18)
E/flutter ( 2962): <asynchronous suspension>

Emulator Pixel 3 API 31

fbernaly avatar Mar 28 '22 23:03 fbernaly

So far, when I use the emulator is not working, but when I use an actual Android device and Chromecast as my secondary display it works. Same for iOS, in case of iPad I can use an HDMI cable or AppleTV. On iPhone I tested AppleTV and it works, I was not able to test cable, because I do not have a lighting to HDMI adapter. So far that is what I am trying to do, and this does not represent an issue for me anymore.

fbernaly avatar Mar 29 '22 18:03 fbernaly

Oh that is good to know. I do think it also needs to work on an emulator, and the issue does also seem to be android specific. Thanks for testing.

joranmulderij avatar Mar 29 '22 19:03 joranmulderij