Not Working with Expo SDK 53 (newArchEnabled = false)
Describe the Bug The player doesn't work when using react-native-track-player with Expo SDK 53 and newArchEnabled = false. The app fails to compile unless I remove the onBind() method in MusicService.kt, but when I do that, the player doesn’t function — no playback, no controls.
This setup worked fine before upgrading to Expo 53.
Steps To Reproduce
- Create a new Expo SDK 53 app.
- Install [email protected].
- Setup react-native-track-player
- Try to build the app.
It fails with a Kotlin error: onBind overrides nothing.
If you remove the onBind() method, the app builds, but the player no longer works.
Replicable on Example App? Not tested on the example app yet.
Environment Info: System: OS: macOS 15.5 Chip: Apple M3 Pro Binaries: Node: 22.14.0 npm: 11.4.1 npmPackages: react-native: 0.79.3 react-native-track-player: 4.1.1 expo: 53.0.11
How I can Help It would be great if you can make it Expo 53 compatible. I can test proposed changes or patches, and try fixes if suggested. Not familiar enough with the Kotlin/Android internals to open a PR right now.
dupe of: https://github.com/doublesymmetry/react-native-track-player/issues/2455
@devtrex007 I had this issue too, it is easily fixed temporarily by using patch-package to modify the file as described in this comment: https://github.com/doublesymmetry/react-native-track-player/issues/2455#issuecomment-2867771771
@alecmolloy Thank you so much, It's working now! It would be great if this fix gets patched into the package. I saw there's a pending commit, hopefully it gets merged soon.