presentation-displays
presentation-displays copied to clipboard
Error in emulator when opening the second display
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:
- Run Pixel C api 30 android emulator
- Add a second display.
- Launch the example app
- Click "Get Displays"
- Put the ID for the second display into the textbox
- Click show presentation
- Look at the console
Expected behavior The second display should show something.
Smartphone:
- Device: Pixel C
- OS: Android api 30
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
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.
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.