Build Error on Xcode 15: Unable to detect any compatible iPhoneOS SDK!

I am currently trying to build my Unity Project(2023.1.9f1) in Xcode and it giving me a build error when I archive it. It just says

Xcode needs to be installed in the /Applications directory and have a name matching Xcode*.app. Or be selected using xcode-select.
It's also possible to use /Library/Developer/CommandLineTools if those match the listed requirements.
 
More information and installation instructions can be found here:
https://developer.apple.com/support/xcode/
 
Specific Xcode versions can be downloaded here:
https://developer.apple.com/download/more/
 
Unable to detect any compatible iPhoneOS SDK!

Over and over again. Here is the full build error: https://pastebin.com/pqM0wCVr. Can anyone help me figure out what is happening? I am not using CocoaPods or Flutter, just Xcode. I am using CommandLineTools and I have already selected it in the dropdown menu. I have also already installed the SDK in the main menu of Xcode. What is going on?

Build Error on Xcode 15: Unable to detect any compatible iPhoneOS SDK!
 
 
Q