ForegroundServiceDidNotStartInTimeException in PlaybackService when using Media3 MediaSessionService
@marcbaechinger is already working on this.
Since May 12, 2025.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
The app crashes on Transsion - Unisoc Itel P40 devices android version 12 with a ForegroundServiceDidNotStartInTimeException in the PlaybackService, which extends Media3’s MediaSessionService. This occurs because the service fails to call startForeground() quickly enough after being started via startForegroundService(). Media3’s MediaSessionService automatically manages some foreground lifecycle steps, but delays in overriding critical methods (like onCreate() or onStartCommand()) can prevent timely startForeground() calls. This crash is isolated to Itel P40 devices, suggesting platform-specific quirks in handling foreground service timeouts.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.