状況
さっきまで問題なくビルドとかできていたAndroidStudio。
一度PCを再起動すると、
Can't start Git: /usr/bin/git
Probably the path to Git executable is not valid.
だと・・・?
ずっとgitと一緒に仲良くやってきたはずなのになぜ?
原因と対処法をまとめました。
ちなみに開発環境はMacです。
原因
ファイルやディレクトリがなくなったりしてるわけではなく、
Xcodeの更新にともなう同意要求が原因でした。
Xcodeが7.3.1から8.0にアップデートされていました。
Xcodeの利用規約に同意しないとgitが実行ができないようです。
対処法
ターミナルから対応
terminalを起動し、gitのある場所に移動。
cd /usr/bin
./git
-> Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
(ライセンスに同意してね。sudoで起動してね)
sudo ./git
->You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.
Hit the Enter key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'
(Xcode規約にまだ同意してないから同意してね。Enterキー押したら規約見せるね。)
[Enter]
-> (利用規約いろいろ〜略)
By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel] agree
(同意したらagreeってタイプしてね。印刷ならprint、それ以外はcancelね。)
agree[enter]
同意しました。
以上で完了です。