Problem: Can't find Xcode install for Metal - See solution below

Getting error message:

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 installation using “xcode-select”

So I tried the most recommended fix terminal ⟶ sudo xcodebuild -license

Error message ⟶

xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance

So search the error message and the most common fix was to reinstall ⟶

xcode-select --install

Error message ⟶
xcode-select: note: Command line tools are already installed. Use “Software Update” in System Settings or the software update command line interface to install updates

Everyone had some of sort fix, but it they were wrong.

!!! The real solution !!!

  • Go into Xcode.app and select [Xcode] in the top left corner

  • Select [Accounts] and manage your [Certificates]

  • Next select [Locations] and review you dev path:
    Correct ⟶ [Users/“your name”/Library/Developer

  • Still in [Locations] select [Command Line Tools] choose yours; for instance:
    ⟶ Xcode 14 (#####)

    • You should see the label underneath showing : “/Applications/Xcode.app”

The reason for the error message:

xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance

Solution: Select [Command Line Tools] to choose the instance from the drop down widget ⟶ Xcode [v#] (#####)

So if you find yourself getting the same error this might be your solution.

2 Likes

Thank You! This solution worked for me!

1 Like

Just ran into this with 5.4.4 and an already installed and working Xcode and wanted to share the fix I did. It seems the paths were not lining up with what UE expected. (This is possibly because I had updated Xcode without opening it to accepts all the settings/license stuff.) As a result, even after getting Xcode back to normal, UE still could not find it. The fix is to make Xcode reset all the paths by running:

sudo xcode-select -r

NOTE: since these tools are controlled by root, you need to do this with sudo.

Hope this helps.