Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
105.55k stars 10.24k forks source link

Mouse not working after newest android update #4596

Closed LiddyBug closed 5 months ago

LiddyBug commented 5 months ago

Describe the bug Up until the latest android update it was working fine, but now today I can't use my mouse or keyboard for it. As far as I'm concerned nothing on my end has changed, I looked at my settings and usb debugging is still on, I'm kind of unfamiliar with all this (a noob with technology) and I am so lost on how to fix this.

[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: android.content.IClipboard$Stub$Proxy.addPrimaryClipChangedListener [interface android.content.IOnPrimaryClipChangedListener, class java.lang.String, class java.lang.String, int]
        at java.lang.Class.getMethod(Class.java:2937)
        at java.lang.Class.getMethod(Class.java:2449)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.getAddPrimaryClipChangedListener(ClipboardManager.java:129)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.addPrimaryClipChangedListener(ClipboardManager.java:139)
        at com.genymobile.scrcpy.Device.<init>(Device.java:100)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:64)
        at com.genymobile.scrcpy.Server.main(Server.java:381)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:415)
[server] ERROR: Exception on thread Thread[Thread-4,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.getDeviceId()' on a null object reference
        at android.content.ContextWrapper.getDeviceId(ContextWrapper.java:1252)
        at android.media.AudioRecord.resolveSessionId(AudioRecord.java:1175)
        at android.media.AudioRecord.<init>(AudioRecord.java:476)
        at android.media.AudioRecord.<init>(Unknown Source:0)
        at android.media.AudioRecord$Builder.build(AudioRecord.java:1062)
        at com.genymobile.scrcpy.AudioCapture.createAudioRecord(AudioCapture.java:58)
        at com.genymobile.scrcpy.AudioCapture.start(AudioCapture.java:90)
        at com.genymobile.scrcpy.AudioEncoder.encode(AudioEncoder.java:183)
        at com.genymobile.scrcpy.AudioEncoder.lambda$start$0$com-genymobile-scrcpy-AudioEncoder(AudioEncoder.java:120)
        at com.genymobile.scrcpy.AudioEncoder$$ExternalSyntheticLambda0.run(Unknown Source:2)
        at java.lang.Thread.run(Thread.java:1012)
INFO: Renderer: direct3d
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Initial texture: 1080x2336
[server] ERROR: Exception on thread Thread[Thread-2,5,main]
java.lang.AssertionError: java.lang.reflect.InvocationTargetException
        at com.genymobile.scrcpy.wrappers.ServiceManager.getInputManager(ServiceManager.java:72)
        at com.genymobile.scrcpy.Device.injectEvent(Device.java:192)
        at com.genymobile.scrcpy.Device.injectEvent(Device.java:196)
        at com.genymobile.scrcpy.Controller.injectTouch(Controller.java:320)
        at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:134)
        at com.genymobile.scrcpy.Controller.control(Controller.java:83)
        at com.genymobile.scrcpy.Controller.lambda$start$0$com-genymobile-scrcpy-Controller(Controller.java:90)
        at com.genymobile.scrcpy.Controller$$ExternalSyntheticLambda0.run(Unknown Source:2)
        at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.genymobile.scrcpy.wrappers.ServiceManager.getInputManager(ServiceManager.java:69)
        ... 8 more
Caused by: java.lang.NullPointerException
        at java.util.Objects.requireNonNull(Objects.java:207)
        at android.hardware.input.InputManager.getInstance(InputManager.java:401)
        ... 10 more
rom1v commented 5 months ago

Upgrade your scrcpy to the latest version.

LiddyBug commented 5 months ago

Upgrade your scrcpy to the latest version.

Gotcha, I thought I didn't see a new version but that totally explains why!

LiddyBug commented 5 months ago

Upgrade your scrcpy to the latest version.

it should be quite obvious but for some reason its not, i downloaded the latest version, I don't see an executable like the version i had previous, where is it located within the folders?

rom1v commented 5 months ago

Did you download it from there: https://github.com/Genymobile/scrcpy/blob/master/doc/windows.md (currently v2.3.1)?

LiddyBug commented 5 months ago

Did you download it from there: https://github.com/Genymobile/scrcpy/blob/master/doc/windows.md (currently v2.3.1)?

yes, i unzipped, was that what i should have done or no?

LiddyBug commented 5 months ago

Did you download it from there: https://github.com/Genymobile/scrcpy/blob/master/doc/windows.md (currently v2.3.1)?

Okay, i read, and i've got the terminal open, however I don't know what I should type in to get it to pull up my phone. Also I am very sorry if this is annoying, I was recommended this by someone who is now not in my life and I can't get their help so I am lost lol.

LiddyBug commented 5 months ago

I figured it out and got it working.