ClassicOldSong / moonlight-android

GameStream client for Android
GNU General Public License v3.0
349 stars 10 forks source link

[Issue]: The Android app crashes every time when it starts streaming, when "Intelligent clipboard synchronization (experimental)" is enabled #62

Closed ZTKenan closed 4 days ago

ZTKenan commented 5 days ago

Describe the bug

I am using Artemis on the Android and connecting to Apollo on the Win 11. The program runs continuously until the resolution of my computer has been changed according to my phone's requirements. Then, the notification bar on my phone pops up with a message saying "The application crashes due to its own reasons". However, it seems that I only exited the stream without disconnecting (the resolution of my computer has not been changed back), and I need to manually disconnect before my computer can return to its original resolution.

Steps to reproduce

Enable "Intelligent clipboard synchronization (experimental)", then start streaming 开启“智能剪贴板同步(实验性)”后串流

Affected games

No response

Other Moonlight clients

PC

Moonlight adjusted settings

Yes

Moonlight adjusted settings (please complete the following information)

Enable "Intelligent clipboard synchronization (experimental)"; Regardless of whether "clipboard sync Toast" is turned off or not 开启“智能剪贴板同步(实验性)”;无论是否关闭“剪贴板同步 Toast”

Moonlight default settings

No

Gamepad-related connection issue

No

Gamepad-related input issue

No

Gamepad-related streaming issue

No

Android version

Android 14; secure update 20240801

Device model

Redmi K70 Ultra

Server PC OS version

Windows 11 professional edition, 23H2, 22631.3737

Server PC GeForce Experience version

(AMD)2024.1011.1706.2043

Server PC Nvidia GPU driver version

(AMD)24.10.1

Server PC antivirus and firewall software

Windows Defender and Huorong; Windows Firewall (only public firewall disabled)

Screenshots

No response

Relevant log output

java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference
    at com.limelight.Game.getClipboardContent(Unknown Source:53)
    at com.limelight.Game.sendClipboard(Unknown Source:11)
    at com.limelight.Game.handleFocusChange(Unknown Source:13)
    at com.limelight.Game$13.run(Unknown Source:70)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:222)
    at android.os.Looper.loop(Looper.java:314)
    at android.app.ActivityThread.main(ActivityThread.java:8830)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:565)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1090)

Additional context

If need any further information, please contact me through the email on my profile page

ClassicOldSong commented 5 days ago

请检查是否给予了剪贴板权限。如果没有的话请在权限管理里手动授予。

正常的Android逻辑即便拒绝了剪贴板,也应该返回空字符串,看起来小米选择给了null,而这并不通用。

PS: 如果英语不熟练的话,可以考虑使用AI翻译或者直接使用母语。不正确的语言表达会更容易引起误会。

ClassicOldSong commented 5 days ago

https://github.com/ClassicOldSong/moonlight-android/releases/tag/v12.1.241128

应该修好了

ZTKenan commented 4 days ago

更新之后相同设置下还是会闪退,提示变成“应用因自身原因闪退”了,日志在最下面 我看了下剪贴板权限,是默认打开的:“仅在使用中允许”(没有“始终允许”)。然后我看小米的系统是只有电话短信这种可以返回空内容,剪贴板是没有返回空内容的选项的 1732756152707 1732756152703 包括写入剪贴板里的“截图自动写入剪贴板”,我也确认过了,我复制一段纯中文的文本也不行 分别用电脑和手机端的todesk连接同一台电脑,剪贴板是能正常同步到本地的

java.lang.ClassCastException: android.text.SpannableString cannot be cast to java.lang.String at com.limelight.Game.getClipboardContent(Unknown Source:89) at com.limelight.Game.sendClipboard(Unknown Source:11) at com.limelight.Game.handleFocusChange(Unknown Source:13) at com.limelight.Game$13.run(Unknown Source:70) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:222) at android.os.Looper.loop(Looper.java:314) at android.app.ActivityThread.main(ActivityThread.java:8830) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:565) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1090)

ClassicOldSong commented 4 days ago

https://github.com/ClassicOldSong/moonlight-android/releases/tag/v12.1.241128-2

再试试看吧,我手头所有设备都是好的。。。当然之前也是,就小米不一样。。。

ZTKenan commented 4 days ago

可以正常用了,谢谢谢谢