XCode12 beta build errors with AVAudioSession APIs

I get the following compilation errors on XCode 12 that are not there when building the same project with XCode 11.
Code Block
preferredAutoMicrophoneLocation = AVAudioSession.Location.orientationFront
Code Block
Error: Type 'AVAudioSession.Location' has no member 'orientationFront'
Has something changed in the new iOS SDK?

Replies

The old name has been deprecated and replaced by AVAudioSession.Location.orientationFront. You should have a compilation message (a note associated with the warning) plus a fix-it to make the change if you're in Xcode.
Oops, sorry, I pasted in the wrong symbol there. The warning I get is 'orientationFront' is deprecated in iOS: renamed to 'AVAudioSession.Orientation.front' so the new symbol you want is AVAudioSession.Orientation.front.
I found it eventually but this is driving me crazy to share projects between XCode11 and XCode12. At times I need XCode12 to test new iOS14 APIs but then XCode12 beta 3 is too buggy so coming back to XCode11 is painful. There are lot of code changes required to make the project compatible with XCode11. For instance, this code
Code Block
if usingFrontCamera {    preferredAutoMicrophoneOrientation = AVAudioSession.Orientation.front
} else {  preferredAutoMicrophoneOrientation = AVAudioSession.Orientation.back
}

It requires a different approach altogether in XCode11. Setting it to AVAudioSession.Orientation.orientationFront doesn't work!