Hello, My App is getting a Fence hang right after install in a specific scenario.
Issue1: I attempted to follow the directions, tried to symbolicate the file etc. however did not have much luck.
I was able to pinpoint the lines of code where the hang seems to occur. I did this using simple print and comment out/uncomment blocks of code related to the specific scenario. I was able to do so as, not much is happening on the Main thread in this scenario .
Issue 2: The following lines of code ( modified var etc. ) seem to cause the hang. Commenting them out gets rid of the hang across devices, while online/offline etc. I am not sure if I need to use a framework other than AVFoundation.
Note:
- The file extension is mpg
- The music files are static ( included in the Bundle ) and not accessed from user's playlist etc.
import <AVFoundation> var plyr : AVAudioPlayer?
let pth = Bundle.main.path(forResource: "MusicFileName", ofType: "mpg")!
let url = URL(fileURLWithPath: pth)
do [{](https://www.example.com/)
plyr = try AVAudioPlayer(contentsOf: url)
plyr?.prepareToPlay()
plyr?.play()
} catch {
// print error etc.
}
Thanks in advance. I would appreciate some help! Close to submission :)
Wav file works!!!
One of the older posts about this topic mentioned use of wav file instead. I tried that and it worked!!!
Apparently mp3 being compressed coupled with use of AVFoundation may have something to do with it but still baffling, as I am simply playing music from statically included Bundle files.
Anyway, onto the rest of testing and debugging hangs if any! 😬