Importing Photos.Framework is causing compile error on macOS Big Sur / Xcode 12 Beta 3

On macOS Big Sur Beta 3 / Xcode 12 Beta 3 when i create vanilla macOS SwiftUI / App project and import Photos framework i get the following compile error:

Code Block
Failed to build module 'Photos' from its module interface; the compiler that produced it, 'Apple Swift version 5.3 (swiftlang-1200.2.22.2 clang-1200.0.25.1)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3 (swiftlang-1200.0.22.4 clang-1200.0.25.1)'

Can i set the swift compiler version from Xcode somehow?

The code i try to compile:

Code Block swift
import SwiftUI
import Photos
struct ContentView: View {
    var body: some View {
        Text("Hello, world!").padding()
    }
}

It was compiling fine on Beta 2 in one of my projects. Created vanilla project just to make sure there wasn't something odd in project config.
The same with AVFoundation

Code Block
Failed to build module 'AVFoundation' from its module interface; the compiler that produced it, 'Apple Swift version 5.3 (swiftlang-1200.2.22.2 clang-1200.0.25.1)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3 (swiftlang-1200.0.22.4 clang-1200.0.25.1)'

Can confirm, same issue here on my project that worked fine with previous Xcode builds :


/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/usr/lib/swift/AVFoundation.swiftmodule/arm64e-apple-macos.swiftinterface:1:1: Failed to build module 'AVFoundation' from its module interface; the compiler that produced it, 'Apple Swift version 5.3 (swiftlang-1200.2.22.2 clang-1200.0.25.1)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3 (swiftlang-1200.0.22.4 clang-1200.0.25.1)'



Looks like a problem with the SDK, hopefully we'll get a fix soon.

FYI, reverting to Xcode beta2 lets you compile again (as the SDK is bundled with the xcode build), I filed a radar, guess we'll see.
Same Error for QuickLook Framework:

Code Block
Failed to build module '_QuickLook_SwiftUI' from its module interface; the compiler that produced it, 'Apple Swift version 5.3 (swiftlang-1200.2.22.2 clang-1200.0.25.1)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3 (swiftlang-1200.0.22.4 clang-1200.0.25.1)'


Seems to be fixed in Xcode 12 Beta 4
Importing Photos.Framework is causing compile error on macOS Big Sur / Xcode 12 Beta 3
 
 
Q