barry-ran / QtScrcpy

Android real-time display control software
https://blog.csdn.net/rankun1/article/details/87970523
Apache License 2.0
17.88k stars 2.42k forks source link

Could not invoke method solution(安卓14息屏报错解决方案) #937

Open LeeSaltyFish opened 3 months ago

LeeSaltyFish commented 3 months ago

当我使用息屏功能的时候/自动息屏功能的时候,会报错如下

AdbProcessImpl::error:[server] ERROR: Could not invoke method java.lang.NoSuchMethodException: android.view.SurfaceControl.getPhysicalDisplayIds [] at java.lang.Class.getMethod(Class.java:2937) at java.lang.Class.getMethod(Class.java:2449) at com.genymobile.scrcpy.wrappers.SurfaceControl.getGetPhysicalDisplayIdsMethod(SurfaceControl.java:137) at com.genymobile.scrcpy.wrappers.SurfaceControl.getPhysicalDisplayIds(SurfaceControl.java:144) at com.genymobile.scrcpy.Device.setScreenPowerMode(Device.java:319) at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:169) at com.genymobile.scrcpy.Controller.control(Controller.java:83) at com.genymobile.scrcpy.Controller.lambda$start$0$com-genymobile-scrcpy-Controller(Controller.java:91) at com.genymobile.scrcpy.Controller$$ExternalSyntheticLambda1.run(Unknown Source:4) at java.lang.Thread.run(Thread.java:1012) [server] ERROR: Could not get physical display ids

LeeSaltyFish commented 3 months ago

the solution

download the scrcpy-server-v2.4

rename the "scrcpy-server-v2.4" to "scrcpy-server"

copy and cover the scrcpy-server in the folder

change the "config.ini" in "config" folder

the change detail is “ServerVersion=2.1.1” to "ServerVersion=2.4"

zslhub commented 3 months ago

@LeeSaltyFish 我使用了你的解决方法,但是没有作用,你看一下有什么解决办法吗?会报错如下 AdbProcessImpl::error:Native registration unable to find class 'com/android/server/DeviceControlService'; aborting...

barry-ran commented 2 months ago

try v2.2.1

zslhub commented 2 months ago

试用 v2.2.1

刚刚尝试了最新版本2.2.1,问题还是存在的,我是使用Android14链接的Windows11(23H2-22631.2506),投屏成功后点击熄屏投屏就断开了,报错如下: AdbProcessImpl::error:Native registration unable to find class 'com/android/server/DeviceControlService'; aborting... AdbProcessImpl::error:Aborted