LoginSignup
3
3

More than 5 years have passed since last update.

突然のAndroidStudioでのエラー『Can't start Git』とその対処法

Last updated at Posted at 2016-10-24

状況

androidstudio.png

さっきまで問題なくビルドとかできていた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]

同意しました。

以上で完了です。

3
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3