cannot access music file from Music app on iPad

Hi I have this piece of code in my app that is supposed to open up a file from Music(old iTunes) app and play. But I get 'Attempted to register account monitor for types client is not authorized to access "com.apple.account.iTunesStore". Any suggests how to fix this. What entitlements do I need to set? Code and error logs are below

code-block
``` func showiPOD() {
     
    let mediaPicker: MPMediaPickerController = MPMediaPickerController.self(mediaTypes:MPMediaType.anyAudio)
    mediaPicker.delegate = self as MPMediaPickerControllerDelegate
    mediaPicker.allowsPickingMultipleItems = false
    mediaPicker.showsCloudItems = true //show from iCloud as well.. needs to be tested
    self.present(mediaPicker, animated: true, completion: nil)
  }

2023-01-24 09:31:22.018992-0800 Smart Practice[526:16253] [Entitlements] MSVEntitlementUtilities - Process Smart Practice PID[526] - Group: (null) - Entitlement: com.apple.accounts.appleaccount.fullaccess - Entitled: NO - Error: (null)
2023-01-24 09:31:22.022520-0800 Smart Practice[526:16253] [core] Attempted to register account monitor for types client is not authorized to access: {(
  "com.apple.account.iTunesStore"
)}

```language
code-block

Where do I need to add this entitlement 'com.apple.accounts.appleaccount.fullaccess' ? I tried to add to . entitlements but now I see error from my Provisioning profile:

Provisioning profile "iOS Team Provisioning Profile: com.osrn.smartpracticenew" doesn't include the com.apple.accounts.appleaccount.fullaccess entitlement and doesn't match the entitlements file's value for the com.apple.developer.applesignin entitlement."

Commenting so I can follow this. I’m getting the same issues using MusicKit in SwiftUI.

Same problem here. Commenting so I can follow along.

I literally get the same thing. My code was working just fine before, but I can't get around this error now.

Hoping someone can give a solution to this.

cannot access music file from Music app on iPad
 
 
Q