AVAudioSession missing from iOS 10 SDK?

Using Xcode 8 GM, I wrote a small iOS app for iOS 10 which makes use of AVAudioSession. I've built that for simulator and it works as expected. However, when I try building for device (iOS 10.0.1), The compiler tells me that it doesn't recognize "AVAudioSession". AVAudioSession is listed in the documentation, and I don't see a deprecation or removal notice. However, when I looked for it in the frameworks, I see AVFoundation does not list it. Doing to AVFoundation.AVFAudio. does list a "AVFoundation.AVFAudio.AVAudioSession", but clicking into that merely says:


import AVFoundation

import Foundation


I looked in plain old AVFoundation for it, but didn't find an audio session.


I switched back to building for simualtor, and AVFoundation.AVFAudio.AVAudioSession now contains a class for AVAudioSession. I don't see a "mac os only" availability listed, so I'm wondering what gives?


I removed the AVAudioSession code and ran the app. It "worked" but didn't work as well as it could have if I had been able to set the correct session category and mode.


It's like the class is present in the simulator SDK, but not in the actual SDK?


Is anyone else seeing this problem? Is it a bug, or did AVAudioSession actually get removed? Do I maybe have a bad download?

Answered by benspratling4 in 179055022

I downloaded the AppStore version of Xcode 8, and it does not have this problem. So the bug was either in the GM, or my download was corrupted.

Accepted Answer

I downloaded the AppStore version of Xcode 8, and it does not have this problem. So the bug was either in the GM, or my download was corrupted.

AVAudioSession missing from iOS 10 SDK?
 
 
Q