Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[server] ERROR: Could not invoke method #4593

Closed
viniL1238 opened this issue Jan 15, 2024 · 8 comments
Closed

[server] ERROR: Could not invoke method #4593

viniL1238 opened this issue Jan 15, 2024 · 8 comments

Comments

@viniL1238
Copy link

Device: Redmi 12
Android OS: 13
Windows 10
Scrcpy 2.3.1

scrcpy 2.3.1 https://github.com/Genymobile/scrcpy
INFO: ADB device found:
INFO: --> (usb) 93ce2d277d78 device 23053RN02L
C:\Users\user\Desktop\scrcpy-win64-v2.3.1\scrcpy-win64-v2.... file pushed, 0 skipped. 47.4 MB/s (66007 bytes in 0.001s)
[server] INFO: Device: [Xiaomi] Redmi 23053RN02L (Android 13)
INFO: Renderer: direct3d
INFO: Texture: 1080x2456
[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:226)
at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:237)
at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:241)
at com.genymobile.scrcpy.Controller.injectKeycode(Controller.java:188)
at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:128)
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)
... 11 more
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.input.InputManagerService.injectInputEventToTarget(InputManagerService.java:906)
at android.hardware.input.IInputManager$Stub.onTransact(IInputManager.java:617)
at android.os.Binder.execTransactInternal(Binder.java:1285)
at android.os.Binder.execTransact(Binder.java:1249)

[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:226)
at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:237)
at com.genymobile.scrcpy.Device.injectKeyEvent(Device.java:241)
at com.genymobile.scrcpy.Controller.injectKeycode(Controller.java:188)
at com.genymobile.scrcpy.Controller.handleEvent(Controller.java:128)
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)
... 11 more

@viniL1238 viniL1238 changed the title [server] ERROR: Could not invoke method #3628 [server] ERROR: Could not invoke method Jan 15, 2024
@viniL1238
Copy link
Author

@rom1v

@rom1v
Copy link
Collaborator

rom1v commented Jan 15, 2024

@viniL1238
Copy link
Author

I checked everything but didn't find anything in the prerequisites that would prevent me from controlling my cell phone.

@rom1v
Copy link
Collaborator

rom1v commented Jan 15, 2024

On some devices, you also need to enable #70 (comment) 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.

@viniL1238
Copy link
Author

I activated it, but it didn't work

@rom1v
Copy link
Collaborator

rom1v commented Jan 15, 2024

Did you reboot your device?

@viniL1238
Copy link
Author

When you say I hadn't done that, but now I restarted it and it did. Thank you very much, you helped me a lot and I'm sorry for the inconvenience.

@viniL1238
Copy link
Author

I will close the comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants