iOS 13.1 Crash in AVAudio Player
I found a crash issue in AVAudioPlayer
with iOS 13.1.
Here Is Solution
Why My AVAudioPlayer
crash? because
I initialise AVAudioPlayer
like
var wrongMusicPlayer: AVAudioPlayer = AVAudioPlayer()
and then i try to reassign wrongMusicPlayer
as below
wrongMusicPlayer = try AVAudioPlayer(contentsOf: wrongURL)
And my app get crash.
Solution
If you initialise your AVAudioPlayer
like var wrongMusicPlayer: AVAudioPlayer = AVAudioPlayer()
OR wrongMusicPlayer = AVAudioPlayer()
in any method then please remove it and just Declare like var wrongMusicPlayer: AVAudioPlayer!
.
App crashes when playing audio on iOS13.1
Change this:
var backgroundMusicPlayer = AVAudioPlayer()
To this:
var backgroundMusicPlayer : AVAudioPlayer!
Re-Assigning instance of AVAudioPlayer in iOS13 leads to BAD_ACCESS runtime error
Just remove the initialisation and it will work
private var mySoundPlayer: AVAudioPlayer!
Cheers!!!
AVAudioPlayer throws breakpoint in debug mode
Add your exception breakpoint and edit the exception type from "All" to "Objective-C exceptions"
Some classes in AudioToolbox throw regular C++ exceptions. You can filter them off this way.
Related Topics
How to Add a Button to the Mkpointannotation
Error When Trying to Obtain a Certificate: the Specified Item Could Not Be Found in the Keychain
How to Add Strings on X Axis in iOS-Charts
How to Maintain Presenting View Controller's Orientation When Dismissing Modal View Controller
Pixel Array to Uiimage in Swift
Firebase Cloud Messaging Doesn't Create Push Notifications But Gets Information
403 Error - Thats an Error. Error: Disallowed_Useragent
Uipangesturerecognizer - Only Vertical or Horizontal
Why Is Uicollectionviewcell's Outlet Nil
Refresh Devices in Team Provisioning Profile Managed by Xcode 7
Why am I Getting Ibtool Failed with Exit Code 255
Xcode 4/iOS - Send an Email Using Smtp from Inside My App
How to Get a Cgpoint from a Tapped Location
Add a Running Countup Display Timer to an iOS App, Like the Clock Stopwatch