I’m converting a MusicKit app from iOS to macOS with Catalyst but can’t get the player to work. The app works flawlessly on iOS but I get the following error in my console on macOS whenever the MPMusicPlayer tries to manipulate the queue by adding a song with a store id
[SDKPlayback] Failed to obtain remoteObject: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.Music.MPMusicPlayerApplicationControllerInternal was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.Music.MPMusicPlayerApplicationControllerInternal was invalidated.}
Both the player, setQueue and play methods are according to the documentation supported on Mac Catalyst 13+:
https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller
https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller/1624253-setqueue
https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller/2582424-preparetoplay
https://developer.apple.com/documentation/mediaplayer/mpmediaplayback/1616255-play