Code I'm using (paraphrased)
private let player = ApplicationMusicPlayer.shared
private func play(songs : [Song]) {
Task.init {
player.setQueue(with: songs)
try await player.prepareToPlay()
player.play()
}
}
When I compile and run on my device (iOS 15 Beta 4), the app SIGABRT crashes on launch (does not hit breakpoints) with:
dyld[9429]: Symbol not found: _$s8MusicKit0A6PlayerC4playyyFTj
Referenced from: /private/var/containers/Bundle/Application/21A3E366-FDC0-481C-B857-99353C8BED87/Soundbooth.app/Soundbooth
Expected in: /System/Library/Frameworks/MusicKit.framework/MusicKit
Symbol not found: _$s8MusicKit0A6PlayerC4playyyFTj
Referenced from: /private/var/containers/Bundle/Application/21A3E366-FDC0-481C-B857-99353C8BED87/Soundbooth.app/Soundbooth
Expected in: /System/Library/Frameworks/MusicKit.framework/MusicKit
Has anyone else seen this behavior?
Post
Replies
Boosts
Views
Activity
Hi there, I am seeing an error when attempting to prepareToPlay on iOS 15 Beta 5. I'm using SystemMusicPlayer's new .queue property directly as setQueue was deprecated. Are there other steps I should be doing to ensure that this method succeeds?
Code:
private func playAppleMusic(songs : [Song]) {
Task.init {
do {
print("0")
try await SystemMusicPlayer.shared.queue.insert(songs, position: .tail)
if (!SystemMusicPlayer.shared.isPreparedToPlay) {
print("1")
try await SystemMusicPlayer.shared.prepareToPlay()
}
print("2")
try await SystemMusicPlayer.shared.play()
} catch let error {
print("playAppleMusic error: \(error.localizedDescription)")
}
}
}
Result:
0
1
playAppleMusic error: The operation couldn’t be completed. (MPMusicPlayerControllerErrorDomain error 1.)