Weird error trying to add Apple Music item to library on iPadOS 16.1

I don't know if this is related to the OS version (iPadOS 16.1) but this used to work for me before on this particular device.

I'm doing this: try await MPMediaLibrary.default().addItem(withProductID: catalogId)

where catalogId is a valid ID I got from MusicKit.

This throws the following error:

Error Domain=MPErrorDomain Code=0 "An unknown error occurred." UserInfo={NSLocalizedDescription=An unknown error occurred., NSUnderlyingError=0x2814a1b60 {Error Domain=ICCloudClientErrorDomain Code=2003 "Attempting to retrieve handler for an unsupported configuration" UserInfo={NSLocalizedFailureReason=An ICCloudClient (or HSCloudClient) instance is using a signed-out user identity., NSLocalizedRecoverySuggestion=Listen to ICActiveUserIdentityDidChangeNotification and either update ICCloudClient with the new active account or recreate it, NSLocalizedDescription=Attempting to retrieve handler for an unsupported configuration}}}

Not a single Google result for that.

The same code on an iPhone with iOS 16.0 works just fine.

I tried observing for Notification.Name("ICActiveUserIdentityDidChangeNotification") but that doesn't seem to be fired.

Well this may well be a bug in the beta release so I just sent feedback to Apple.

I hit the exact same error (see here). By the way you might want to try adding the MusicKit tag to your post.

So far for the WWDC22 enhancements to MusicKit I’m finding:

  • Catalyst isn’t supported, period
  • iPad is meant to be supported but doesn’t work
  • iPhone kind-of works but good luck getting any help or support when you have questions

I’m disappointed, to put it mildly.

Weird error trying to add Apple Music item to library on iPadOS 16.1
 
 
Q