error build: Undefined symbol: __swift_FORCE_LOAD_$_swiftUIKit

Hi, I am getting this error.

warning build: Directory not found for option '-L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/iOSSupport/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/maccatalyst'

warning build: Could not find or use auto-linked library 'swiftUIKit'

error build: Undefined symbol: __swift_FORCE_LOAD_$_swiftUIKit

I have tried adding all these ways https://stackoverflow.com/questions/56855766/xcode-build-fails-due-to-undefined-symbol-swift-force-load-swiftuikit But the error still exists. I am trying to build the project for my mac catalyst.

Xcode version is 14.0.1

My Mac chip: Mac M1

Fixed by creating a swift file and bridge in Mac OS Earlier I was using IOS.

error build: Undefined symbol: __swift_FORCE_LOAD_$_swiftUIKit
 
 
Q