scrcpy
scrcpy copied to clipboard
SCRCPY Broken for Android 14 QPR3 Beta
Environment
- OS: Windows
- scrcpy version: v2.3.1
- installation method: Windows Release
- Google Pixel 7 pro
- Android version: Android 14 QPR3 Beta 1
Describe the bug After installing Android 14 QPR3 Beta 1 scrcpy doesnt work. I think they changed the method.
[server] INFO: Device: [Google] google Pixel 7 Pro (Android 14)
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.AssertionError: java.lang.NoSuchMethodException: android.view.SurfaceControl.createDisplay [class java.lang.String, boolean]
at com.genymobile.scrcpy.wrappers.SurfaceControl.createDisplay(SurfaceControl.java:85)
at com.genymobile.scrcpy.ScreenCapture.createDisplay(ScreenCapture.java:77)
at com.genymobile.scrcpy.ScreenCapture.start(ScreenCapture.java:38)
at com.genymobile.scrcpy.SurfaceEncoder.streamScreen(SurfaceEncoder.java:72)
at com.genymobile.scrcpy.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-SurfaceEncoder(SurfaceEncoder.java:253)
at com.genymobile.scrcpy.SurfaceEncoder$$ExternalSyntheticLambda0.run(Unknown Source:4)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.NoSuchMethodException: android.view.SurfaceControl.createDisplay [class java.lang.String, boolean]
at java.lang.Class.getMethod(Class.java:2937)
at java.lang.Class.getMethod(Class.java:2449)
at com.genymobile.scrcpy.wrappers.SurfaceControl.createDisplay(SurfaceControl.java:83)
... 6 more
INFO: Renderer: direct3d
ERROR: Demuxer 'audio': stream disabled due to connection error
INFO: Texture: 1440x3120
WARN: Device disconnected
[server] INFO: Device: [Google] google Pixel 8 Pro (Android 14)
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.AssertionError: java.lang.NoSuchMethodException: android.view.SurfaceControl.createDisplay [class java.lang.String, boolean]
at com.genymobile.scrcpy.wrappers.SurfaceControl.createDisplay(SurfaceControl.java:85)
at com.genymobile.scrcpy.ScreenCapture.createDisplay(ScreenCapture.java:77)
at com.genymobile.scrcpy.ScreenCapture.start(ScreenCapture.java:38)
at com.genymobile.scrcpy.SurfaceEncoder.streamScreen(SurfaceEncoder.java:72)
at com.genymobile.scrcpy.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-SurfaceEncoder(SurfaceEncoder.java:253)
at com.genymobile.scrcpy.SurfaceEncoder$$ExternalSyntheticLambda0.run(Unknown Source:4)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.NoSuchMethodException: android.view.SurfaceControl.createDisplay [class java.lang.String, boolean]
at java.lang.Class.getMethod(Class.java:2937)
at java.lang.Class.getMethod(Class.java:2449)
at com.genymobile.scrcpy.wrappers.SurfaceControl.createDisplay(SurfaceControl.java:83)
... 6 more
INFO: Renderer: direct3d
ERROR: Demuxer 'audio': stream disabled due to connection error
INFO: Texture: 1344x2992
WARN: Device disconnected
Please post your framework.jar:
adb pull /system/framework/framework.jar
I had already posted it above
I had already posted it above
Congrats! 🥳🎊
Thank you for your framework.jar
.
Indeed, they removed the method. There was a lot of refactor in Android regarding the display starting in Android 14 (#3927, #4011), it seems they are continuing the work, which causes a lot of changes.
This will require investigations to adapt the code (but the AOSP sources where the method is removed are not available yet).
Refs #4646.
Please test this fix (the link to scrcpy-server
in the comment): https://github.com/Genymobile/scrcpy/pull/4657#issuecomment-1935845644
@rom1v Can confirm it works
@rom1v Thank you - the updated scrcpy-server has resolved this issue for me also. Same device and Android version as @MemeCornucopia
I'll add that scrcpy does manage to turn my Pixel 7's screen off before it crashes
adb connect `netstat -nr |head|grep default|awk '{ print $2 }'` ; scrcpy --stay-awake --turn-screen-off --power-off-on-close -e
already connected to 192.168.12.67:5555
scrcpy 2.3.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO: --> (tcpip) 192.168.12.67:5555 device Pixel_7
/opt/homebrew/Cellar/scrcpy/2.3.1/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 198.3 MB/s (66007 bytes in 0.000s)
[server] INFO: Device: [Google] google Pixel 7 (Android 14)
INFO: Renderer: metal
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.AssertionError: java.lang.NoSuchMethodException: android.view.SurfaceControl.createDisplay [class java.lang.String, boolean]
at com.genymobile.scrcpy.wrappers.SurfaceControl.createDisplay(SurfaceControl.java:85)
at com.genymobile.scrcpy.ScreenCapture.createDisplay(ScreenCapture.java:77)
ERROR: Demuxer 'audio': stream disabled due to connection error
at com.genymobile.scrcpy.ScreenCapture.start(ScreenCapture.java:38)
at com.genymobile.scrcpy.SurfaceEncoder.streamScreen(SurfaceEncoder.java:72)
at com.genymobile.scrcpy.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-SurfaceEncoder(SurfaceEncoder.java:253)
at com.genymobile.scrcpy.SurfaceEncoder$$ExternalSyntheticLambda0.run(Unknown Source:4)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.NoSuchMethodException: android.view.SurfaceControl.createDisplay [class java.lang.String, boolean]
at java.lang.Class.getMethod(Class.java:2937)
at java.lang.Class.getMethod(Class.java:2449)
at com.genymobile.scrcpy.wrappers.SurfaceControl.createDisplay(SurfaceControl.java:83)
... 6 more
ERROR: Demuxer error
[server] ERROR: Audio capture error
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1638)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:420)
at com.genymobile.scrcpy.AudioEncoder.inputThread(AudioEncoder.java:91)
at com.genymobile.scrcpy.AudioEncoder.lambda$encode$1$com-genymobile-scrcpy-AudioEncoder(AudioEncoder.java:195)
at com.genymobile.scrcpy.AudioEncoder$$ExternalSyntheticLambda2.run(Unknown Source:4)
at java.lang.Thread.run(Thread.java:1012)
scrcpy --version
scrcpy 2.3.1 <https://github.com/Genymobile/scrcpy>
Dependencies (compiled / linked):
- SDL: 2.28.5 / 2.30.0
- libavcodec: 60.3.100 / 60.31.102
- libavformat: 60.3.100 / 60.16.100
- libavutil: 58.2.100 / 58.29.100
- libusb: - / 1.0.27
Edit: @rom1v works for me, too!
sweet I thought my Pixel 7 with a dead screen was not working \ USB debugging issue with my PC, I just looked and saw it was a different error (same as above) so I came to look in here and found you guys digging into it.
flawlessly worked after replacing scrpy-server with the updated one. thanks!
Please test this fix (the link to
scrcpy-server
in the comment): #4657 (comment)
doesnt work for Poco M5S on Android 13.
[server] ERROR: Could not invoke method
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.genymobile.scrcpy.wrappers.InputManager.injectInputEvent(InputManager.java:37)
at com.genymobile.scrcpy.Device.injectEvent(Device.java:230)
at com.genymobile.scrcpy.Device.injectEvent(Device.java:234)
at com.genymobile.scrcpy.Controller.injectTouch(Controller.java:323)
at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:138)
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)
Caused by: java.lang.SecurityException: Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.
at android.os.Parcel.createExceptionOrNull(Parcel.java:3011)
at android.os.Parcel.createException(Parcel.java:2995)
at android.os.Parcel.readException(Parcel.java:2978)
at android.os.Parcel.readException(Parcel.java:2920)
at android.hardware.input.IInputManager$Stub$Proxy.injectInputEventToTarget(IInputManager.java:1294)
at android.hardware.input.InputManager.injectInputEvent(InputManager.java:1153)
at android.hardware.input.InputManager.injectInputEvent(InputManager.java:1182)
... 10 more
@oguzokbalbesov This has nothing to do with this problem. Please read https://github.com/Genymobile/scrcpy#prerequisites
Yes, it's explained in the section I linked:
On some devices, you also need to enable an additional option
USB debugging (Security Settings)
(this is an item different from USB debugging) to control it using a keyboard and mouse. Rebooting the device is necessary once this option is set.
I don't know if this is related to the build from @rom1v but I thought I'd mention scrcpy froze once and I couldn't reconnect with scrcpy complaining that "ERROR: Could not find any ADB device" despite the fact that nmap showed the port was still open. After maybe a half hour of doing nothing (phone was in another room) it magically worked again so I don't know what that was all about.
ERROR: Could not find any ADB device
What was the result of adb devices
?
https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#device-not-detected
ERROR: Could not find any ADB device
What was the result of
adb devices
?https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#device-not-detected
If I could go back in time I'd tell ya. Let me know if there is anything else you'd like me to test if it happens again.
Late to the party, but the modified scrcpy-server is working for me. I had just run a git pull when I saw it not work initially, so I guess that new file wasn't included.
ERROR: Could not find any ADB device
What was the result of
adb devices
?https://github.com/Genymobile/scrcpy/blob/master/FAQ.md#device-not-detected
So it's happening again and adb devices shows no devices. Port 5555 is open according to nmap
Edit: again, it cleared itself up eventually via some magic.
我应该如何替换他