Can't find Xcode install for Metal compiler. Please install Xcode and run Xcode.app to accept license or ensure active developer directory is set to current Xcode installation using xcode-select

I got the same issue when trying to launch both U 5.0.1 and U 4.27.2… watching different youtubers for answers, but none of those working on mine. Anyone know how to fix this???