I experienced this on macOS and I had to make sure I pointed xcode-select -s to the Xcode.app I am using
xcode-select -s
Xcode.app