我正在尝试为 Surface Duo 构建一个 Xamarin Forms 项目。项目运行,但不会同时使用这两个屏幕。我按照 Xamarin for Surface Duo - Dual-screen | 中的步骤进行操作 微软文档:
更新了指向 SDK 的指针。
添加
Xamarin.Forms.DualScreen.DualScreenService.Init(this);
到mainactivity.cs
.修改了 Activity 缩写以包括:
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.UiMode
.在 Android 应用程序中包含 Xamarin.DuoSdk 包。
在阅读模拟器输出时,一行建议使用 bcdedit 命令关闭 hyper-V,我这样做了。
已选择
<build>
(Android 10.0 – API 29)
我下载了一些示例(Sketch 360 和双屏演示),但没有让它们同时使用两个屏幕。我运行了 Get 上发布的演示,并更新了软件包,但没有运气。我检查了模拟器中的手机设置,看看是否有启用两个屏幕的设置,但没有找到任何东西。模拟器输出中有一些错误和警告,但不知道如何修复它们。
仿真器输出
emulator: Silencing all qWarning(); use qCWarning(...) instead: QT_LOGGING_RULES=default.warning=false
Failed to open /qemu.conf, err: 2
emulator: INFO: QtLogger.cpp:68: Critical: UpdateLayeredWindowIndirect failed for ptDst=(1283, 327), size=(700x21), dirty=(700x108 0, 0) (A device attached to the system is not functioning.) ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Critical: UpdateLayeredWindowIndirect failed for ptDst=(1283, 327), size=(700x21), dirty=(700x21 0, 0) (A device attached to the system is not functioning.) ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Critical: Uncaught TypeError: Cannot read property 'update' of undefined (qrc:/html/js/location-mock-web-channel.js:130, (null))
构建输出
System.InvalidCastException: Unable to cast object of type 'Mono.Debugger.Soft.PointerValue' to type 'Mono.Debugger.Soft.PrimitiveValue'.
System.InvalidCastException: Unable to cast object of type 'Mono.Debugger.Soft.PointerValue' to type 'Mono.Debugger.Soft.PrimitiveValue'.
System.InvalidCastException: Unable to cast object of type 'Mono.Debugger.Soft.PointerValue' to type 'Mono.Debugger.Soft.PrimitiveValue'.
02-06 20:34:52.574 W/libc ( 3873): Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
02-06 20:34:54.961 W/OpenGLRenderer( 3873): Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...