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

Wireless ADB gives "NoSuchMethodException", and a few minutes later "Warn: Device disconnected" #3770

Closed
e-t-l opened this issue Mar 5, 2023 · 3 comments

Comments

@e-t-l
Copy link

e-t-l commented Mar 5, 2023

  • [x ] I have read the FAQ.
  • [x ] I have searched in existing issues.

Environment

  • OS: Windows 11
  • scrcpy version: 1.22
  • installation method: Windows release
  • device model: Pixel 7
  • Android version: 13

Describe the bug
When connecting ADB over Wifi, scrcpy will usually connect for a few minutes, then disconnect with the WARN: Device disconnected message. However, the console outputs some lines with errors before that, so I don't know if there's anything I need to change to make it run better and hopefully stop crashing? I haven't been able to capture logcat for it, but here is the full CMD output:

C:\Program Files\SCRCPY\scrcpy-server: 1 file pushed, 0 skipped. 3.4 MB/s (40955 bytes in 0.012s)
[server] INFO: Device: Google Pixel 7 (Android 13)
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: android.content.IClipboard$Stub$Proxy.addPrimaryClipChangedListener [interface android.content.IOnPrimaryClipChangedListener, class java.lang.String, int]
        at java.lang.Class.getMethod(Class.java:2103)
        at java.lang.Class.getMethod(Class.java:1724)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.getAddPrimaryClipChangedListener(ClipboardManager.java:103)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.addPrimaryClipChangedListener(ClipboardManager.java:111)
        at com.genymobile.scrcpy.Device.<init>(Device.java:103)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:64)
        at com.genymobile.scrcpy.Server.main(Server.java:326)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2400
WARN: Device disconnected

Is there an issue that I can address regarding the NoSuchMethodException?

@e-t-l
Copy link
Author

e-t-l commented Mar 5, 2023

Nevermind, just saw #3497. I'll update to v1.25 and only reopen the issue if that doesn't fix it.

@e-t-l e-t-l closed this as completed Mar 5, 2023
@e-t-l
Copy link
Author

e-t-l commented Mar 5, 2023

Updating to v1.25 did fix the method error, but I'm still seeing device disconnected after a few minutes. Checking with adb devices, I can see that my device is still actively connected to ADB. It's just scrcpy that seems to have disconnected for some reason.

I acknowledge this isn't much info to go on, so I'll reopen this once I have some logcat output to share.

@rom1v
Copy link
Collaborator

rom1v commented Mar 5, 2023

Run adb shell or adb logcat in a separate terminal while running scrcpy. Does the command terminate at the same time as scrcpy? If so, it's an adb disconnection.

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