lingochamp / lingochamp/FileDownloader

FileDownloadService.inspectRunServiceForeground android.app.MissingForegroundServiceTypeException - Starting FGS without a type callerApp=ProcessRecord{ae38c1e 15288:filedownloader/u0a146} targetSDK=34

Open
#1,426 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
11.1k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

#### Before Issue

Fatal Exception: java.lang.RuntimeException
Unable to start service com.liulishuo.filedownloader.services.FileDownloadService$SeparateProcessService@795b2a1 with Intent { cmp=com.liulishuo.filedownloader.services.FileDownloadService$SeparateProcessService (has extras) }: android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{33802c4 20109:filedownloader/u0a330} targetSDK=34

Fatal Exception: java.lang.RuntimeException: Unable to start service com.liulishuo.filedownloader.services.FileDownloadService$SeparateProcessService@795b2a1 with Intent { cmp=com.liulishuo.filedownloader.services.FileDownloadService$SeparateProcessService (has extras) }: android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{33802c4 20109:filedownloader/u0a330} targetSDK=34
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5286)
at android.app.ActivityThread.-$$Nest$mhandleServiceArgs()
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2531)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8893)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)



Caused by android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{33802c4 2010:filedownloader/u0a330} targetSDK=34
at android.app.MissingForegroundServiceTypeException$1.createFromParcel(MissingForegroundServiceTypeException.java:53)
at android.app.MissingForegroundServiceTypeException$1.createFromParcel(MissingForegroundServiceTypeException.java:49)
at android.os.Parcel.readParcelableInternal(Parcel.java:4882)
at android.os.Parcel.readParcelable(Parcel.java:4864)
at android.os.Parcel.createExceptionOrNull(Parcel.java:3064)
at android.os.Parcel.createException(Parcel.java:3053)
at android.os.Parcel.readException(Parcel.java:3036)
at android.os.Parcel.readException(Parcel.java:2978)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7214)
at android.app.Service.startForeground(Service.java:775)
at com.liulishuo.filedownloader.services.FileDownloadService.inspectRunServiceForeground(FileDownloadService.java:150)
at com.liulishuo.filedownloader.services.FileDownloadService.onStartCommand(FileDownloadService.java:150)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5268)
at android.app.ActivityThread.-$$Nest$mhandleServiceArgs()
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2531)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8893)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

#### Issue
FileDownloadService.inspectRunServiceForeground android.app.MissingForegroundServiceTypeException - Starting FGS without a type callerApp
Get this crash on Android 14 and mostly Samsung Devices with android 14
---

请在Issue前认真的跟进上面提到的建议,这样将可以极大的加快你遇到问题的处理。

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at FileDownloadService.inspectRunServiceForeground and its call from onStartCommand, using the stack trace locations in FileDownloadService.java. Reproduce the failure on Android 14, especially a Samsung device, with targetSDK 34. Done means the SeparateProcessService can start its foreground service without MissingForegroundServiceTypeException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.