Solved: Since my project is a SwiftPM package, the release binary has to be manually codesigned so that MediaPlayer can work properly.
Post
Replies
Boosts
Views
Activity
func addItemsToQueue<T>(
items: MusicItemCollection<T>,
at position: ApplicationMusicPlayer.Queue.EntryInsertionPosition
) async
where T: PlayableMusicItem {
do {
if player.queue.entries.isEmpty {
player.queue = .init(for: items)
} else {
try await player.queue.insert(items, position: position)
}
} catch {
await logger?.error(
"Unable to add songs to player queue: \(error.localizedDescription)"
)
return
}
do {
if !player.isPreparedToPlay {
await logger?.trace("Preparing player...")
try await player.prepareToPlay()
}
} catch {
await logger?.critical("Unable to prepare player: \(error.localizedDescription)")
}
}
This is a snippet which produces this error.
For some insane reason it only works on release builds.
I am completely frustrated and there is no way to check what is going wrong inside the MusicKit library
Having the same issue but on macOS 15.0.1 only on release builds of the app. The debug version works perfectly.