SIGABRT when running an app with MusicKit's ApplicationMusicPlayer.shared

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?

Hello @funemployedin,

I believe you are seeing this error because we had to change the declaration of the play() in beta 4 with the async throws annotations.

Unfortunately, there was no good way for us to stage this nicely with a deprecation warning.

So I believe you are hitting this issue because you are probably using the iOS 15 beta 3 SDK to deploy to a device running beta 4.

I recommend you upgrade to the iOS 15 beta 4 SDK, and then you’ll get the proper compiler support to know how to change your code so it will work correctly.

I hope this helps.

Best regards,

SIGABRT when running an app with MusicKit's ApplicationMusicPlayer.shared
 
 
Q