maxrave-dev / SimpMusic

A simple music app using YouTube Music for backend
https://simpmusic.tech/
GNU General Public License v3.0
1.9k stars 114 forks source link

Crashing on specific song #200

Closed OwenD30 closed 10 months ago

OwenD30 commented 10 months ago

Describe the bug A couple seconds into playing "Air I Breathe" by Sondae, the app crashes with an error message

To Reproduce Steps to reproduce the behavior:

  1. Search for the song above
  2. Hit play

Expected behavior The song should play without errors

Video https://github.com/maxrave-dev/SimpMusic/assets/77121604/be6184d5-cf96-4c2d-9059-423e2ff0b32f

Log (Error Details)

Build version: 0.1.7 Current date: 2023-12-23 20:08:30 Device: Google Pixel 7 OS version: Android 14 (SDK 34)

Stack trace:
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) at java.util.Objects.checkIndex(Objects.java:359) at java.util.ArrayList.get(ArrayList.java:434) at com.maxrave.simpmusic.viewModel.SharedViewModel.getActiveLyrics(SharedViewModel.kt:860) at com.maxrave.simpmusic.ui.fragment.player.NowPlayingFragment$onViewCreated$10$1$job5$1$1.emit(NowPlayingFragment.kt:583) at com.maxrave.simpmusic.ui.fragment.player.NowPlayingFragment$onViewCreated$10$1$job5$1$1.emit(NowPlayingFragment.kt:570) at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:396) at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:15) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:68) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:260) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking(Builders.kt:59) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking$default(Builders.kt:38) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1) at com.maxrave.simpmusic.viewModel.SharedViewModel.sponsorBlockEnabled(SharedViewModel.kt:1081) at com.maxrave.simpmusic.ui.MainActivity$onCreate$11$job1$1$1.emit(MainActivity.kt:592) at com.maxrave.simpmusic.ui.MainActivity$onCreate$11$job1$1$1.emit(MainActivity.kt:590) at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:396) at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:15) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:68) at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:245) at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:163) at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:474) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:508) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:497) at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:368) at kotlinx.coroutines.flow.StateFlowSlot.makePending(StateFlow.kt:284) at kotlinx.coroutines.flow.StateFlowImpl.updateState(StateFlow.kt:349) at kotlinx.coroutines.flow.StateFlowImpl.setValue(StateFlow.kt:316) at com.maxrave.simpmusic.service.SimpleMediaServiceHandler.startProgressUpdate(SimpleMediaServiceHandler.kt:397) at com.maxrave.simpmusic.service.SimpleMediaServiceHandler.access$startProgressUpdate(SimpleMediaServiceHandler.kt:42) at com.maxrave.simpmusic.service.SimpleMediaServiceHandler$startProgressUpdate$1.invokeSuspend(Unknown Source:14) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:235) at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:168) at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:474) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:508) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:497) at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:595) at kotlinx.coroutines.android.HandlerContext$scheduleResumeAfterDelay$$inlined$Runnable$1.run(Runnable.kt:19) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8470) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@a07af69, Dispatchers.Main.immediate]

User actions: 2023-12-23 20:07:48: MainActivity created 2023-12-23 20:07:49: MainActivity resumed

maxrave-dev commented 10 months ago

Give me URL to this playlist

OwenD30 commented 10 months ago

https://youtube.com/playlist?list=PLVlg3nkqCmEAkBOOu98IsRh6tQn7-nfH7

Johndjk commented 10 months ago

Exactly the same error for me.

URL: https://m.youtube.com/playlist?list=OLAK5uy_nHy9AQa4vZ3De0zzhjXqt0P-lCRnSiukA

Description:

Only the songs Sweet, Fingertips and Margaret (feat. Bleachers) reproduced without errors doing the playback test following the order, however, after random switching between tracks only Sweet remained without errors.

Log (Error details of the first song crash)

Build version: 0.1.7 Current date: 2023-12-27 05:01:44 Device: Xiaomi Redmi 9 OS version: Android 13 (SDK 33)

Stack trace:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.get(ArrayList.java:437) at com.maxrave.simpmusic.viewModel.SharedViewModel.getActiveLyrics(SharedViewModel.kt:860) at com.maxrave.simpmusic.ui.fragment.player.NowPlayingFragment$onViewCreated$10$1$job5$1$1.emit(NowPlayingFragment.kt:583) at com.maxrave.simpmusic.ui.fragment.player.NowPlayingFragment$onViewCreated$10$1$job5$1$1.emit(NowPlayingFragment.kt:570) at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:396) at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:15) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:68) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:260) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking(Builders.kt:59) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1) at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking$default(Builders.kt:38) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1) at com.maxrave.simpmusic.viewModel.SharedViewModel.sponsorBlockEnabled(SharedViewModel.kt:1081) at com.maxrave.simpmusic.ui.MainActivity$onCreate$11$job1$1$1.emit(MainActivity.kt:592) at com.maxrave.simpmusic.ui.MainActivity$onCreate$11$job1$1$1.emit(MainActivity.kt:590) at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:396) at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:15) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:68) at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:245) at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:163) at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:474) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:508) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:497) at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:368) at kotlinx.coroutines.flow.StateFlowSlot.makePending(StateFlow.kt:284) at kotlinx.coroutines.flow.StateFlowImpl.updateState(StateFlow.kt:349) at kotlinx.coroutines.flow.StateFlowImpl.setValue(StateFlow.kt:316) at com.maxrave.simpmusic.service.SimpleMediaServiceHandler.startProgressUpdate(SimpleMediaServiceHandler.kt:397) at com.maxrave.simpmusic.service.SimpleMediaServiceHandler.access$startProgressUpdate(SimpleMediaServiceHandler.kt:42) at com.maxrave.simpmusic.service.SimpleMediaServiceHandler$startProgressUpdate$1.invokeSuspend(Unknown Source:14) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:235) at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:168) at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:474) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:508) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:497) at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:595) at kotlinx.coroutines.android.HandlerContext$scheduleResumeAfterDelay$$inlined$Runnable$1.run(Runnable.kt:19) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7924) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@6eea61c, Dispatchers.Main.immediate]

User actions: 2023-12-27 05:01:17: MainActivity created 2023-12-27 05:01:18: MainActivity resumed