バージョン
MacOS:Monterey 12.4
Unity:2021.3.3f1
Xcode:13.4.1
Google Mobile Ads:v7.0.2
はじめに
Google Mobile Adsを入れて初期設定しただけのプロジェクトで
Unityのビルドボタンを押したところ
下記のエラーが発生
BuildFailedException: Burst compiler (1.6.5) failed running
stdout:
Failed to determine xcode installation path - "xcode-select -p" is XCode installed? xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
stderr:
日本語訳
BuildFailedException:バーストコンパイラ(1.6.5)の実行に失敗しました
stdout:
xcodeのインストールパスを特定できませんでした-「xcode-select-p」はXCodeがインストールされていますか? xcrun:エラー:無効なアクティブな開発者パス(/ Library / Developer / CommandLineTools)、次の場所にxcrunがありません:/ Library / Developer / CommandLineTools / usr / bin / xcrun
stderr:

対策
Xcodeのパスが取得できていないとのことなので設定します。
ターミナルを開きます。

Xcode最新版に切り替えるため、ターミナルに以下を入力し、エンターを押します。
(ターミナルでの操作となりますので自己責任にてお願いします。)
sudo xcode-select --switch /Applications/Xcode.app
入力後、パソコンのパスワードの入力されるので入力します。
(パスワードを入力してもターミナル上には表示されません。)

パスワード入力後、特に変化はありませんが、設定完了です。
これでビルド再トライをしたところ、
Unityでのビルドが成功しました。
おわりに
ビルドは通りましたが、CocoaPodsアップデートしろのエラーが出たので別で書きます。
iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.
After the failure, "pod repo update" was executed and succeeded. "pod install" was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: https://guides.cocoapods.org/using/troubleshooting.html for potential solutions.
pod install output:
Analyzing dependencies
Adding spec repotrunkwith CDNhttps://cdn.cocoapods.org/
CocoaPods 1.11.3 is available.
To update use:gem install cocoapods
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.11.3
[!]GoogleAppMeasurementrequires CocoaPods version>= 1.10.2, which is not satisfied by your current version,1.10.1.
追記
今回もこの内容でアップデートしてエラー無くなりました。