Skip to content

Crash Bug. Flow crashes when downloading a large music playlist #724

Description

@LynnAnEar

Describe the Bug

Downloading of large music playlists crashes flow.

Steps to Reproduce

  1. Open Flow and navigate to 'Library'
  2. Tap on 'Music Playlists'
  3. Perform an album 'Download'
  4. Flow lags and crashes after awhile. it also crashes SystemUI randomly.

Expected Behavior

Finish the download without crashing

Actual Behavior

Flow becomes slow and laggy then crashes. Multiple times.

Error 1:
Exception: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException Message: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{5227922 u0 io.github.aedev.flow.nightly/io.github.aedev.flow.data.video.downloader.FlowDownloadService c:io.github.aedev.flow.nightly}

Device Info: Model: Pixel 9a Manufacturer: Google Android: 16 (SDK 36) Brand: google Device: tegu App Version: 2.1.5-nightly (16)

Stack Trace: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{5227922 u0 io.github.aedev.flow.nightly/io.github.aedev.flow.data.video.downloader.FlowDownloadService c:io.github.aedev.flow.nightly} at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2531) at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2499) at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2883) at android.os.Handler.dispatchMessage(Handler.java:132) at android.os.Looper.dispatchMessage(Looper.java:333) at android.os.Looper.loopOnce(Looper.java:263) at android.os.Looper.loop(Looper.java:367) at android.app.ActivityThread.main(ActivityThread.java:9328) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)

Error 2:
Exception: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException Message: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{7df37e5 u0 io.github.aedev.flow.nightly/io.github.aedev.flow.data.video.downloader.FlowDownloadService c:io.github.aedev.flow.nightly}

Device Info: Model: Pixel 9a Manufacturer: Google Android: 16 (SDK 36) Brand: google Device: tegu App Version: 2.1.5-nightly (16)

Stack Trace: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{7df37e5 u0 io.github.aedev.flow.nightly/io.github.aedev.flow.data.video.downloader.FlowDownloadService c:io.github.aedev.flow.nightly} at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2531) at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2499) at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2883) at android.os.Handler.dispatchMessage(Handler.java:132) at android.os.Looper.dispatchMessage(Looper.java:333) at android.os.Looper.loopOnce(Looper.java:263) at android.os.Looper.loop(Looper.java:367) at android.app.ActivityThread.main(ActivityThread.java:9328) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929) Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here at android.app.ContextImpl.startServiceCommon(ContextImpl.java:2115) at android.app.ContextImpl.startForegroundService(ContextImpl.java:2069) at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:875) at io.github.aedev.flow.data.video.downloader.FlowDownloadService$Companion.startDownload(FlowDownloadService.kt:197) at io.github.aedev.flow.data.video.downloader.FlowDownloadService$Companion.startDownload$default(FlowDownloadService.kt:156) at io.github.aedev.flow.data.music.DownloadManager$downloadTrack$2.invokeSuspend(DownloadManager.kt:184) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:266) at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:99) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)

Error 3:
Exception: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException Message: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{761780d u0 io.github.aedev.flow.nightly/io.github.aedev.flow.data.video.downloader.FlowDownloadService c:io.github.aedev.flow.nightly}

Device Info: Model: Pixel 9a Manufacturer: Google Android: 16 (SDK 36) Brand: google Device: tegu App Version: 2.1.5-nightly (16)

Stack Trace: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{761780d u0 io.github.aedev.flow.nightly/io.github.aedev.flow.data.video.downloader.FlowDownloadService c:io.github.aedev.flow.nightly} at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2531) at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2499) at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2883) at android.os.Handler.dispatchMessage(Handler.java:132) at android.os.Looper.dispatchMessage(Looper.java:333) at android.os.Looper.loopOnce(Looper.java:263) at android.os.Looper.loop(Looper.java:367) at android.app.ActivityThread.main(ActivityThread.java:9328) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)

Error 4:
Exception: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException Message: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{820f189 u0 io.github.aedev.flow.nightly/io.github.aedev.flow.data.video.downloader.FlowDownloadService c:io.github.aedev.flow.nightly}

Device Info: Model: Pixel 9a Manufacturer: Google Android: 16 (SDK 36) Brand: google Device: tegu App Version: 2.1.5-nightly (16)

Stack Trace: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{820f189 u0 io.github.aedev.flow.nightly/io.github.aedev.flow.data.video.downloader.FlowDownloadService c:io.github.aedev.flow.nightly} at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2531) at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2499) at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2883) at android.os.Handler.dispatchMessage(Handler.java:132) at android.os.Looper.dispatchMessage(Looper.java:333) at android.os.Looper.loopOnce(Looper.java:263) at android.os.Looper.loop(Looper.java:367) at android.app.ActivityThread.main(ActivityThread.java:9328) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)

Environment

Field Value
Device Google Pixel 9a
Android Version Android: 16 (SDK 36)
Flow Version 2.1.5-nightly (16)
Installation Source GitHub APK
ROM CrDroid

Frequency

  • Every time (100% reproducible)
  • Often (happens most of the time)
  • Sometimes (happens intermittently)
  • Rarely (happened once or twice)

Affected Area

  • Video playback
  • Music player
  • Home feed / Recommendations
  • Search
  • Downloads
  • Subscriptions
  • Playlists
  • Picture-in-Picture / Background playback
  • Notifications
  • Settings / Preferences
  • Import / Export
  • Casting
  • SponsorBlock / DeArrow
  • Lyrics / Subtitles
  • UI / Theming
  • Performance / Battery
  • Other (describe below)

Logs (Optional but Helpful)

Click to expand logs

Additional Context

I will paste a logcat soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompletedFeature is fully implemented

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions