Some album artwork from MPMediaItem display as nil

Hey there, I'm trying to display all user's albums using the MediaPlayer library. I'm getting many albums returning nil, but I know artwork exists because they show up in the default Music app. There doesn't seem to be much rhyme or reason for what shows up and what doesn't. All downloaded albums display artwork, but some cloud album artwork displays as well. Here's the code I'm using to debug this.

let query = MPMediaQuery.albums()

if let albumCollections = query.collections {
  albums = albumCollections
}

for album in albums {
  let artwork = album.representativeItem?.artwork
  print(artwork,  artwork?.image(at: CGSize(width: 100, height: 100)))
  }

Any help would be greatly appreciated. Thanks!

I'm having the same issue. artwork field is not nil but it doesn't return any image when .image(at:) method is called.

Did you manage solve it?

Same issue, especially when loading an artwork for the first time, that happens a lot.

Some album artwork from MPMediaItem display as nil
 
 
Q