scrcpy: SCRCPY Broken for Android 14 QPR3 Beta

  • I have read the FAQ.
  • I have searched in existing issues.

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

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Reactions: 8
  • Comments: 20

Commits related to this issue

Most upvoted comments

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!

@rom1v Can confirm it works

Please test this fix (the link to scrcpy-server in the comment): https://github.com/Genymobile/scrcpy/pull/4657#issuecomment-1935845644

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!

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.

@rom1v

frameworrk.jar

sorry for the late reply.