Gadgetbridge crashes with Amazon Music #2485

Closed
opened 2021-12-03 06:55:26 +00:00 by profriemke · 7 comments

I got Gadgetbridge from:

  • F-Droid
  • I built it myself from source code (specify tag / commit)

Issue:

Gadgetbridge crashes with Amazon Music

When start/stop/forward/back music vom a Bangle.js 2 Gadgetbridge always crashes with Amazon Music (but not with any other music apps e.g. Youtube music). The crashes occur randomly, but usually after sending 2-5 of the above mentioned commands.

Your wearable device is:

Bangle.js 2

Your android version is:

10 Q3

Your Gadgetbridge version is:

0.62.0

### I got Gadgetbridge from: * [x] F-Droid * [ ] I built it myself from source code (specify tag / commit) #### Issue: <details> <summary>Gadgetbridge crashes with Amazon Music</summary> When start/stop/forward/back music vom a Bangle.js 2 Gadgetbridge always crashes with Amazon Music (but not with any other music apps e.g. Youtube music). The crashes occur randomly, but usually after sending 2-5 of the above mentioned commands. </details> #### Your wearable device is: Bangle.js 2 #### Your android version is: 10 Q3 #### Your Gadgetbridge version is: 0.62.0
Contributor

Can you please provide logs using adb logcat from eithee your phone's shell, computer's shell or Android Studio?

All three options have tutorials online for your specific setup.

Can you please provide logs using `adb logcat` from eithee your phone's shell, computer's shell or Android Studio? All three options have tutorials online for your specific setup.
Author
also with Netflix: http://forum.espruino.com/conversations/370802/#comment16303067

There's a logcat in that conversion on the Bangle forum, but here it is as well...

Edit: This is with Gadgetbridge 0.63.0, by the way. And this log is just an excerpt from the full log since this was where the crash happened. The full log can be sent if anyone needs it.

There's a logcat in that conversion on the Bangle forum, but here it is as well... Edit: This is with Gadgetbridge 0.63.0, by the way. And this log is just an excerpt from the full log since this was where the crash happened. The full log can be sent if anyone needs it.
Contributor
Uncaught exception: Unable to start service nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService@799f27 with Intent { act=nodomain.freeyourgadget.gadgetbridge.devices.action.setmusicstate cmp=nodomain.freeyourgadget.gadgetbridge/.service.DeviceCommunicationService (has extras) }: java.lang.ArrayIndexOutOfBoundsException: length=4; index=-1java.lang.RuntimeException: Unable to start service nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService@799f27 with Intent { act=nodomain.freeyourgadget.gadgetbridge.devices.action.setmusicstate cmp=nodomain.freeyourgadget.gadgetbridge/.service.DeviceCommunicationService (has extras) }: java.lang.ArrayIndexOutOfBoundsException: length=4; index=-1
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4339) ~[na:0.0]
	at android.app.ActivityThread.access$1800(ActivityThread.java:238) ~[na:0.0]
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1952) ~[na:0.0]
	at android.os.Handler.dispatchMessage(Handler.java:106) ~[na:0.0]
	at android.os.Looper.loop(Looper.java:223) ~[na:0.0]
	at android.app.ActivityThread.main(ActivityThread.java:7661) ~[na:0.0]
	at java.lang.reflect.Method.invoke(Native Method) ~[na:0.0]
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594) ~[na:0.0]
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) ~[na:0.0]
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=4; index=-1
	at nodomain.freeyourgadget.gadgetbridge.service.devices.banglejs.BangleJSDeviceSupport.onSetMusicState(BangleJSDeviceSupport.java:416) ~[na:0.0]
	at nodomain.freeyourgadget.gadgetbridge.service.ServiceDeviceSupport.onSetMusicState(ServiceDeviceSupport.java:197) ~[na:0.0]
	at nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService.handleAction(DeviceCommunicationService.java:536) ~[na:0.0]
	at nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService.onStartCommand(DeviceCommunicationService.java:362) ~[na:0.0]
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4321) ~[na:0.0]
	... 8 common frames omitted

Relevant code lines

            String[] musicStates = {"play", "pause", "stop", ""};
            o.put("state", musicStates[stateSpec.state]);

It seems that BangleJS support can't handle music playback state -1.

Players having no clue if they're playing something or not is very dumb, but it'd be nice not to crash.

``` Uncaught exception: Unable to start service nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService@799f27 with Intent { act=nodomain.freeyourgadget.gadgetbridge.devices.action.setmusicstate cmp=nodomain.freeyourgadget.gadgetbridge/.service.DeviceCommunicationService (has extras) }: java.lang.ArrayIndexOutOfBoundsException: length=4; index=-1java.lang.RuntimeException: Unable to start service nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService@799f27 with Intent { act=nodomain.freeyourgadget.gadgetbridge.devices.action.setmusicstate cmp=nodomain.freeyourgadget.gadgetbridge/.service.DeviceCommunicationService (has extras) }: java.lang.ArrayIndexOutOfBoundsException: length=4; index=-1 at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4339) ~[na:0.0] at android.app.ActivityThread.access$1800(ActivityThread.java:238) ~[na:0.0] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1952) ~[na:0.0] at android.os.Handler.dispatchMessage(Handler.java:106) ~[na:0.0] at android.os.Looper.loop(Looper.java:223) ~[na:0.0] at android.app.ActivityThread.main(ActivityThread.java:7661) ~[na:0.0] at java.lang.reflect.Method.invoke(Native Method) ~[na:0.0] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594) ~[na:0.0] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) ~[na:0.0] Caused by: java.lang.ArrayIndexOutOfBoundsException: length=4; index=-1 at nodomain.freeyourgadget.gadgetbridge.service.devices.banglejs.BangleJSDeviceSupport.onSetMusicState(BangleJSDeviceSupport.java:416) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.ServiceDeviceSupport.onSetMusicState(ServiceDeviceSupport.java:197) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService.handleAction(DeviceCommunicationService.java:536) ~[na:0.0] at nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService.onStartCommand(DeviceCommunicationService.java:362) ~[na:0.0] at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4321) ~[na:0.0] ... 8 common frames omitted ``` Relevant code lines ``` String[] musicStates = {"play", "pause", "stop", ""}; o.put("state", musicStates[stateSpec.state]); ``` It seems that BangleJS support can't handle music playback state `-1`. Players having no clue if they're playing something or not is very dumb, but it'd be nice not to crash.
Member

Great - thanks for finding this! I'll push an update now.

Great - thanks for finding this! I'll push an update now.
Member

I don't seem to be able to mark this as closed myself? But it should now be fixed.

I don't seem to be able to mark this as closed myself? But it should now be fixed.
Author

Great! Thanks!

Great! Thanks!
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Freeyourgadget/Gadgetbridge#2485
No description provided.