Open Discovery-Prachi opened 4 years ago
We are getting following crash sometimes while casting videos and switching to new videos quickly. When we start casting new video we are calling
remoteMediaClient?.stop()
and then load the new one.Could you please guide us what can be done to avoid this crash:
cast SDK version used: com.google.android.gms:play-services-cast-framework:18.0.0
android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{c3019d0 u0 com.discovery.plus.uat/com.google.android.gms.cast.framework.media.MediaNotificationService} at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1945) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Any updates on this?
Any updates on this? @Discovery-JSwapnil and @pnkshir did you get to fix this ? If yes, can you give some thoughts of how can this be fixed?
@anjaneesh We ran into this exception once in a while where the cast session fails because of business logic related errors (location constraints etc).
It seems like Sender SDK invokes startForegroundService
but the immediate failure results in stopService
even before the service could invoke startForeground
. Ideally, Android Framework should not fail such cases. Could this be handled in the Sender SDK to fail gracefully where stopService
is delayed until service invokes startForeground
?
All occurrences were in Android 9.
We are getting following crash sometimes while casting videos and switching to new videos quickly. When we start casting new video we are calling
remoteMediaClient?.stop()
and then load the new one.Could you please guide us what can be done to avoid this crash:
cast SDK version used: com.google.android.gms:play-services-cast-framework:18.0.0
android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{c3019d0 u0 com.discovery.plus.uat/com.google.android.gms.cast.framework.media.MediaNotificationService} at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1945) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)