MusicKit play back with Mac Catalyst seems not be working.

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 ?

Answered by Frameworks Engineer in 702126022

Hello @bpereiradasilva and @talking small,

Thank you very much for your feedback about issues with ApplicationMusicPlayer in a Mac Catalyst app.

Bringing ApplicationMusicPlayer and SystemMusicPlayer to macOS does present some significant engineering challenges for us, which is why we have yet to enable support for this API on macOS.

For Mac Catalyst specifically, our early tests of these APIs seemed promising, so we initially didn't see any reason to restrict availability of these APIs for that environment. But evidently, we need to keep investigating issues like the ones you have uncovered to make these APIs work reliably in Mac Catalyst apps.

We will keep investigating those issues.

Best regards,

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.

Accepted Answer

Hello @bpereiradasilva and @talking small,

Thank you very much for your feedback about issues with ApplicationMusicPlayer in a Mac Catalyst app.

Bringing ApplicationMusicPlayer and SystemMusicPlayer to macOS does present some significant engineering challenges for us, which is why we have yet to enable support for this API on macOS.

For Mac Catalyst specifically, our early tests of these APIs seemed promising, so we initially didn't see any reason to restrict availability of these APIs for that environment. But evidently, we need to keep investigating issues like the ones you have uncovered to make these APIs work reliably in Mac Catalyst apps.

We will keep investigating those issues.

Best regards,

Joe - what are we supposed to use for playback in a Mac app? This seems like something that should be called out in an overview or intro doc.

Hello @dimsumthinking,

At the moment, we don't have any better answer than the one I've already given.

We will keep investigating these issues with MusicKit's playback APIs on macOS.

Best regards,

Is there still no update on this seven months later?

So here we are, another year goes by, another new operating system release and no fix.

Apple have abandoned developers for Music; the API where implemented is incredibly unreliable with basic design frustrations all over it, while the vendor-provided applications are rife with bugs and bewildering, inconsistent UI design and navigation choices.

Apple doesn't care.

I'm abandoning Apple Music in all application development from this point and moving it to Spotify, and will be recommending Spotify as a preferred service henceforth.

MusicKit play back with Mac Catalyst seems not be working.
 
 
Q