Skip to content

[BUG] crash in background, foreground service while app already closed #1462#1500

Open
MianMuzammil67 wants to merge 1 commit intoanilbeesetti:mainfrom
MianMuzammil67:main
Open

[BUG] crash in background, foreground service while app already closed #1462#1500
MianMuzammil67 wants to merge 1 commit intoanilbeesetti:mainfrom
MianMuzammil67:main

Conversation

@MianMuzammil67
Copy link
Contributor

This PR fixes a crash that occurs when the app is closed while the foreground service is running.

Changes:

  • Start foreground service immediately in PlayerService to avoid RemoteServiceException

Related issue: #1462

@anilbeesetti
Copy link
Owner

Hi @MianMuzammil67, Did you manage to reproduce this crash?

@MianMuzammil67
Copy link
Contributor Author

Yes, I was able to reproduce it, and the crash no longer occurs after the fix.

@MianMuzammil67
Copy link
Contributor Author

@anilbeesetti I’m new to contributing to open source and I noticed that my pull request #1462 was automatically closed. I’m not sure why this happened and wanted to check if there’s something I need to do to fix it or reopen it.

Thank you for your time and guidance!

@anilbeesetti
Copy link
Owner

Yes, I was able to reproduce it, and the crash no longer occurs after the fix.

Can you let me know how you reproduced this crash

@anilbeesetti
Copy link
Owner

@anilbeesetti I’m new to contributing to open source and I noticed that my pull request #1462 was automatically closed. I’m not sure why this happened and wanted to check if there’s something I need to do to fix it or reopen it.

Thank you for your time and guidance!

Don't know why it's automatically closed, I'm reopening it

@anilbeesetti anilbeesetti reopened this Jan 13, 2026
@MianMuzammil67
Copy link
Contributor Author

Yes, I was able to reproduce it, and the crash no longer occurs after the fix.

Can you let me know how you reproduced this crash

I was able to reproduce it by playing any video, pausing it, then pressing the Home button to close the app and switching to another app. Shortly after, Android shows a message saying that Next Player has crashed.

@MianMuzammil67
Copy link
Contributor Author

@anilbeesetti Hi! Just checking in to see if there's anything else needed from my side to get this merged. All checks have passed and the changes were approved earlier. Let me know if there's anything else you'd like me to address. Thanks!

@anilbeesetti
Copy link
Owner

Hey, I'm unable to reproduce this error, so I can't verify whether this fix resolves the issue. Additionally, I'm currently preparing a new version release and would like to check if this crash still occurs in the new version before proceeding with this PR.

@MianMuzammil67
Copy link
Contributor Author

@anilbeesetti , thanks for the update!

That makes sense. Since you’re preparing a new release and can’t reproduce the crash on your end, I’m totally fine with waiting until you’ve had a chance to verify it against the new version.

For reference, I was able to reproduce the crash consistently on Android 11 redmi note 9 by:

  1. Playing any video
  2. Pausing playback
  3. Pressing Home to background the app
  4. Switching to another app

Shortly after, the app would crash with a foreground service–related error. The fix prevents that behavior on my end.

If there’s any additional logging, testing, or changes you’d like me to help with, I’m happy to do so. Thanks for taking a look, and good luck with the release!

@anilbeesetti
Copy link
Owner

@MianMuzammil67, Can you check if the app is still crashing in 0.15.0. If yes can you please share a screen recording for me to look into. Thanks

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