iOS 17 beta AVAudioPlayer mp3 problem

Turn on address sanitizer on Xcode and use a real device and put a Test.mp3 file in the Xcode project. Then it will crash when you initialise a AVAudioPlayer with a mp3 file (with a wav file it works fine). I have made an entry in feedback assistent -> FB12425453.

    var player : AVAudioPlayer?
    
    func playSound() {
        if let url = Bundle.main.url(forResource: "Test", withExtension: "mp3") {
            self.player = try? AVAudioPlayer(contentsOf: url)   // --> deallocation of non allocated memory problem --> with a "wav" file it works 
            ....
        }
     }

Is there a workaround? I'm getting app crashes on launch because of this.

Same issue from ios17 beta 1 to beta 5, they never fixes LOL

Same issue in RC. It's not just MP3, it's AAC and IAM4 as well. It'll only play uncompressed PCM for some reason, but only for apps built using XCode. Even worse, anything built with XCode on previous iOS versions where it works fine will start crashing when updating to iOS 17 - so it's not a problem somehow limited to XCode 15 either. For whatever reason, apps distributed through App Store and TestFlight do not suffer from the same problem. Only direct builds to the device.

Did anyone find a workaround for this!? I'm seeing this with Xcode 15 RC (15A240d), but only when running on the Simulator. When I run on device while connected to Xcode, or make an AppStore or TestFlight build everything works fine.

Also I don't get any crashes when I turn on the Address Sanitizer, either on Simulator or Device.

Still broken in Xcode5.0/iOS 17.0 official version 🎉🎉

Hi,

We're facing this issue as well on iOS 17.1.1 official release Did you get a reply on your feedback assistent ticket? The link you provided results in 'Feedback not found' for me.

Our app seems to run fine from TestFlight or App Store, but crashes when running from XCode.

As a temp workarround I've disabled address sanitizer on my run scheme in XCode.

iOS 17 beta AVAudioPlayer mp3 problem
 
 
Q