Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/Android: crash in Media Service #325

Conversation

kot331107
Copy link
Contributor

Lib versions:

    "react-native-theoplayer": "7.2.0",
    "theoplayer": "7.4.0",

Description:

We have a repetitive crash in Android app with the following logcat:

Fatal Exception: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{4020d8b u0 com.gotv.nflgamecenter.us.lite/com.theoplayer.media.MediaPlaybackService}
       at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2245)
       at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2216)
       at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2508)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8762)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Testing plan:

The issue occurs only in production so we're not able to provide a repro app/steps/snippets whatever. As we had this crash before and were able to resolve it in this way I'd like to suggest these changes for your codebase.
Also let's keep it open until we have a confirmation with the latest stats from Crashlytics that the crash is gone (it might take some time). Please lmk if any objections @tvanlaerhoven

@tvanlaerhoven
Copy link
Member

Also adding this related issue from Google's tracker here:
https://issuetracker.google.com/issues/307329994

@kot331107
Copy link
Contributor Author

closing as it didn't resolve on our end (we've tested it as a patch)

@kot331107 kot331107 closed this Sep 9, 2024
@kot331107 kot331107 deleted the potential-fix-for-android-crashes-in-media-service branch September 9, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants