Test flight app crashes with libAVFAudio.dylib: AVAE_RaiseException(NSString*, ...) + 60
Asked Answered
P

1

6

I uploaded an archive on app store and am getting crash when I 'm trying to play an intro sound. I'm using AVAudioEngine to play the sound. When I compile and run code through Xcode everything works fine. When I upload on TestFlight and try to run my app as an internal tester my app crashes. The crash report is:

enter image description here

If I use AVAudioPlayer to play that sound it's ok. I can't understand what is the problem with AVAudioEngine. Any advices?

Publish answered 31/10, 2015 at 7:55 Comment(3)
I have the same problem... Can anyone advise?Leannaleanne
Any updates, I'm facing the same problem?Schopenhauerism
I never found a solution... I used AVAudioPlayer instead.Publish
D
2

I faced the same exception only in the release build of my app and specific to iPhone7. The exception seems to occur at a changing point of audio session category. In my case, changing from

AVAudioSessionCategorySoloAmbient

to

AVAudioSessionCategoryPlayAndRecord, with:  AVAudioSessionCategoryOptions.defaultToSpeaker

I found a workaround which works at least just for me.

The following article https://forums.developer.apple.com/thread/65656 tells that this kind of exception occurs at initialization of multiple input audio unit.

In order to prevent initialization of multiple input audio unit, I added the following codes before the change of audio session category

AudioOutputUnitStop((engine.inputNode?.audioUnit)!)
AudioUnitUninitialize((engine.inputNode?.audioUnit)!)

engine is the instance of AVAudioEngine.

I hope it will help you guys!

Dunk answered 27/3, 2017 at 5:54 Comment(1)
This isn't working and also then requires microphone access.Bensen

© 2022 - 2024 — McMap. All rights reserved.