RemoteServiceException
Number 1 crash for 3.2 release is: RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground()
All of this despite previous efforts with:
- startForeground called immediately on
onStartCommand
-
MediaParsingService
start is postponed if app is not in foreground state on Android 9.
Found stactraces matches with S8 and Xiaomi Mi Box.
It seems to happen on TV a bit more often than it does on phone.
Here is the Play Store stacktrace
android.app.RemoteServiceException:
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1872)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:214)
at android.app.ActivityThread.main (ActivityThread.java:7050)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)
at Android.MODEL (Android.java)
at Android.VERSION (Android.java)
at Android.FINGERPRINT (Android.java)
I finally identified it by artificially reproducing on S8, stacktrace matches:
android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{cb5d6ae u0 org.videolan.vlc.debug/org.videolan.vlc.MediaParsingService}
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1872)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7050)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Edited by Geoffrey Métais