stadiamaps / stadiamaps/ferrostar
Foreground service related crash
- Dominant language
- Kotlin
- Stars
- 419
- Forks
- 81
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 7
Description
Got this interesting crash in the demo app... Nothing particularly interesting about the session. I had just started it up in the emulator and was idle (during a trip, but no inputs since location was static at the time).
```
2024-11-09 01:39:49.123 3755-3755 AndroidRuntime com.stadiamaps.ferrostar.demo E FATAL EXCEPTION: main
Process: com.stadiamaps.ferrostar.demo, PID: 3755
android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{9148e2a u0 com.stadiamaps.ferrostar.demo/com.stadiamaps.ferrostar.core.service.FerrostarForegroundService}
at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2104)
at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2075)
at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2369)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
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:971)
Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1952)
at android.app.ContextImpl.startForegroundService(ContextImpl.java:1906)
at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:830)
at com.stadiamaps.ferrostar.core.service.FerrostarForegroundServiceManager.startService(ForegroundServiceManager.kt:65)
at com.stadiamaps.ferrostar.core.FerrostarCore.startNavigation(FerrostarCore.kt:228)
at com.stadiamaps.ferrostar.core.FerrostarCore.startNavigation$default(FerrostarCore.kt:220)
at com.stadiamaps.ferrostar.DemoNavigationSceneKt$DemoNavigationScene$4$1$1$1$1$1$1.invokeSuspend(DemoNavigationScene.kt:155)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
```
Contributor guide
Assessment
This issue has not been assessed yet.