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

clipboard cannot be synchronized: #4589

Closed
2 tasks done
Jackyttl opened this issue Jan 15, 2024 · 10 comments
Closed
2 tasks done

clipboard cannot be synchronized: #4589

Jackyttl opened this issue Jan 15, 2024 · 10 comments

Comments

@Jackyttl
Copy link

Jackyttl commented Jan 15, 2024

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

Environment

  • OS: windows 11 , Android 14
  • scrcpy version: scrcpy-win64-v2.3.1
  • installation method: Windows
  • device model:vivo iqoo 11
  • Android version: 14 (PD2243B_A_14.1.8.9.W10.V0
    OOL1)

Describe the bug

Cutting and pasting Android text cannot be pasted in Windows, The cut and paste function cannot be synchronized.
Only from computer to mobile phone(shift+alt+v)
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: android.content.IClipboard$Stub$Proxy.getPrimaryClip [class java.lang.String, int, class java.lang.String]
at java.lang.Class.getMethod(Class.java:2937)
at java.lang.Class.getMethod(Class.java:2449)
at com.genymobile.scrcpy.wrappers.ClipboardManager.getGetPrimaryClipMethod(ClipboardManager.java:44)
at com.genymobile.scrcpy.wrappers.ClipboardManager.getText(ClipboardManager.java:117)
at com.genymobile.scrcpy.Device.getClipboardText(Device.java:286)
at com.genymobile.scrcpy.Device$3.dispatchPrimaryClipChanged(Device.java:143)
at android.content.IOnPrimaryClipChangedListener$Stub.onTransact(IOnPrimaryClipChangedListener.java:84)
at android.os.Binder.execTransactInternal(Binder.java:1410)
at android.os.Binder.execTransact(Binder.java:1341)

@rom1v
Copy link
Collaborator

rom1v commented Jan 15, 2024

Thank you for your report.

device model:vivo iqoo 11

Already fixed on dev branch: #4492

@rom1v rom1v closed this as completed Jan 15, 2024
@Jackyttl
Copy link
Author

framework.zip
Try replacing the following two files, and the clipboard problem will not change.

scrcpy-server SHA-256: 0e9c436a5b319e4dc00f0420e5d2d81a00a4d169f3fc0e2417b429d38f8f299

one with the boolean being false
And one with the boolean being true:

scrcpy-server SHA-256: b7a94328d87e00be7f8c5a8cced09aaa21310921a92b7a5ba31e721e7cb958b

@rom1v
Copy link
Collaborator

rom1v commented Jan 15, 2024

Try replacing the following two files, and the clipboard problem will not change.

That's surprising, since your framework.jar contains exactly the same change as in #4492.

Please post the new stacktrace (output in the console). If it's exactly the same as in your original post, then it means that it still uses the old scrcpy-server.

@Jackyttl
Copy link
Author

Thank you for your reply , I tried the new "false" & "true" scrcpy-server, 32bit scrcpy, 64bit scrcpy all errors occurred.

scrcpy 2.3.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)       10ACCM2LSQ00114            device  V2243A
C:\Users\J-TTL\Desktop\新增資料夾 (2)\新增資料夾... file pushed, 0 skipped. 50.6 MB/s (66115 bytes in 0.001s)
[server] INFO: Device: [vivo] vivo V2243A (Android 14)
INFO: Renderer: direct3d
INFO: Texture: 1440x3200
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: android.content.IClipboard$Stub$Proxy.getPrimaryClip [class java.lang.String, class java.lang.String, int, int, boolean]
        at java.lang.Class.getMethod(Class.java:2937)
        at java.lang.Class.getMethod(Class.java:2449)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.getGetPrimaryClipMethod(ClipboardManager.java:48)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.getText(ClipboardManager.java:124)
        at com.genymobile.scrcpy.Device.getClipboardText(Device.java:286)
        at com.genymobile.scrcpy.Device$3.dispatchPrimaryClipChanged(Device.java:143)
        at android.content.IOnPrimaryClipChangedListener$Stub.onTransact(IOnPrimaryClipChangedListener.java:84)
        at android.os.Binder.execTransactInternal(Binder.java:1410)
        at android.os.Binder.execTransact(Binder.java:1341)
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: android.content.IClipboard$Stub$Proxy.getPrimaryClip [class java.lang.String, class java.lang.String, int, int, boolean]
        at java.lang.Class.getMethod(Class.java:2937)
        at java.lang.Class.getMethod(Class.java:2449)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.getGetPrimaryClipMethod(ClipboardManager.java:48)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.getText(ClipboardManager.java:124)
        at com.genymobile.scrcpy.Device.getClipboardText(Device.java:286)
        at com.genymobile.scrcpy.Device$3.dispatchPrimaryClipChanged(Device.java:143)
        at android.content.IOnPrimaryClipChangedListener$Stub.onTransact(IOnPrimaryClipChangedListener.java:84)
        at android.os.Binder.execTransactInternal(Binder.java:1410)
        at android.os.Binder.execTransact(Binder.java:1341)
[server] ERROR: Could not invoke method
java.lang.NoSuchMethodException: android.content.IClipboard$Stub$Proxy.getPrimaryClip [class java.lang.String, class java.lang.String, int, int, boolean]
        at java.lang.Class.getMethod(Class.java:2937)
        at java.lang.Class.getMethod(Class.java:2449)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.getGetPrimaryClipMethod(ClipboardManager.java:48)
        at com.genymobile.scrcpy.wrappers.ClipboardManager.getText(ClipboardManager.java:124)
        at com.genymobile.scrcpy.Device.getClipboardText(Device.java:286)
        at com.genymobile.scrcpy.Device$3.dispatchPrimaryClipChanged(Device.java:143)
        at android.content.IOnPrimaryClipChangedListener$Stub.onTransact(IOnPrimaryClipChangedListener.java:84)
        at android.os.Binder.execTransactInternal(Binder.java:1410)
        at android.os.Binder.execTransact(Binder.java:1341)

@rom1v rom1v reopened this Jan 16, 2024
@rom1v
Copy link
Collaborator

rom1v commented Jan 16, 2024

Please test this:

@Jackyttl
Copy link
Author

Jackyttl commented Jan 17, 2024

Thank you very much for your answer. I have another question about wifi connection. Scrcpy will automatically exit (WARN: Device disconnected) when the power button of the phone is pressed or the phone is in standby. This does not happen with USB connection.

scrcpy -s 192.168.128.80:5555
scrcpy 2.3.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     --> (tcpip)   192.168.128.80:5555            device  V2243A
C:\Users\J-TTL\Desktop\scrcpy-win64-v2.3.1\scrcpy-server: 1 file pushed, 0 skipped. 6.2 MB/s (66351 bytes in 0.010s)
[server] INFO: Device: [vivo] vivo V2243A (Android 14)
INFO: Renderer: direct3d
INFO: Texture: 1440x3200`
INFO: Device clipboard copied
WARN: Device disconnected

@rom1v
Copy link
Collaborator

rom1v commented Jan 17, 2024

This is unexpected. The adb connection should not be closed in that case.

If you run adb shell or adb logcat when the phone is connected wirelessly, does it also terminate when you press the power button?

rom1v added a commit that referenced this issue Jan 17, 2024
@rom1v
Copy link
Collaborator

rom1v commented Jan 17, 2024

Please test this:

* [`scrcpy-win64-fix4589.zip`](https://tmp.rom1v.com/scrcpy/4589/1/scrcpy-win64-fix4589.zip) `SHA-256: 72efe75ad01363e07471d89a3ee63c69dad57bb8b786996be0a4e08afabcc5a`

Since it works, 5187f72 merged into dev.

@rom1v rom1v closed this as completed Jan 17, 2024
@Jackyttl
Copy link
Author

adb shell and adb logcat , The situation is the same. After turning the screen on and off on the phone, it returns to C:\scrcpy-win64-v2.3.1-16-g4a885cc2b>

anged: newState = NON_METERED, airplaneModeOn = false, notifyAnyway = false
01-17 19:14:51.990 32579 32579 D StandbyModeManager: onReceive action: android.intent.action.SCREEN_ON
01-17 19:14:51.991 32579 32579 D MSF.C.DeepSleepDetector: onScreenOn hasInDeepSleep false
01-17 19:14:51.997 32579 32579 D MSF.C.LogManager: onReceive broadcastreceiver.action = android.intent.action.SCREEN_ON
01-17 19:14:52.053 17448 17448 D MicroMsg.NetworkSignalUtil:  0: WifiManager.RSSI_CHANGED_ACTION
01-17 19:14:54.571  2290  5568 D BatteryStatsService: notePemString  noteWhich: 49,arg1: -2, arg2: -1, arg3: 4271, arg4: 15712, name: com.vivo.systemuiplugin
01-17 19:14:54.673  2290  5568 D BatteryStatsService: notePemString  noteWhich: 49,arg1: -2, arg2: -1, arg3: 4271, arg4: 15712, name: com.vivo.systemuiplugin

C:\scrcpy-win64-v2.3.1-16-g4a885cc2b>

@rom1v
Copy link
Collaborator

rom1v commented Jan 17, 2024

OK, so something on your device close the adb (or adb server crashes?) when you turn the screen off.

armm29393 added a commit to armm29393/scrcpy-root that referenced this issue May 24, 2024
scrcpy v2.4

Changes since v2.3.1:
 - Add UHID keyboard and mouse support (Genymobile#4473)
 - Simulate tilt multitouch by pressing Shift (Genymobile#4529)
 - Add rotation support for non-default display (Genymobile#4698)
 - Improve audio player (Genymobile#4572)
 - Adapt to display API changes in Android 15 (Genymobile#4646, Genymobile#4656, Genymobile#4657)
 - Adapt audio workarounds to Android 14 (Genymobile#4492)
 - Fix clipboard for IQOO devices on Android 14 (Genymobile#4492, Genymobile#4589, Genymobile#4703)
 - Fix integer overflow for audio packet duration (Genymobile#4536)
 - Rework cleanup (Genymobile#4649)
 - Upgrade FFmpeg to 6.1.1 in Windows releases (Genymobile#4713)
 - Upgrade libusb to 1.0.27 in Windows releases (Genymobile#4713)
 - Various technical fixes
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