I have be trying to use the sample code project associated with WWDC21 session 10294: Meet MusicKit for Swift, with Catalyst.
The apps works on mac correctly excepted the playback and the barcode scanning (that is out of my scope)
The following message is displayed continuously:
MusicAlbums[30849:533531] [SDKPlayback] Failed to obtain synchronousRemoteObject: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.Music.MPMusicPlayerApplicationControllerInternal was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.Music.MPMusicPlayerApplicationControllerInternal was invalidated: failed at lookup with error 3 - No such process.}
Before diving deeper i wanted to know if some of you have been able to play music via MusicKit with Mac catalyst?
The sample code uses an ApplicationMusicPlayer.shared
that is not available directly on macOS. (In fact none of the Music players are available)
Would you recommend another approach to provide MusicKit playback on mac os ?
I filed feedback FB9851840 (including sample project) reporting this very issue just moments before seeing this post. I get the same error as you. The documentation page for MusicPlayer does not mention it is available in macOS, but says it is in Mac Catalyst 15.0+, so it's not clear what is supposed to work. Perhaps @JoeKun can shed some light on the expected behavior of this API? I am really hoping to bring my iOS music player to the Mac in the future.