LoginSignup
9
3

More than 5 years have passed since last update.

carthage updateでgitのエラーが発生して処理が中断してしまうときの対応方法

Last updated at Posted at 2018-05-09

状況

Carthageを使ってライブラリを導入しようとするも、毎回途中で失敗する

実行コマンド

carthage update --platform iOS

エラー文

A shell task (/usr/bin/env git checkout --quiet 2e38ee3e7a3e1dd01be31edb94368c2f4a840915 (launched in /Users/Macユーザ名/プロジェクトディレクトリ/Carthage/Checkouts/ライブラリ名/Carthage/Checkouts/ほげほげ)) failed with exit code 128:
fatal: reference is not a tree: 2e38ee3e7a3e1dd01be31edb94368c2f4a840915

原因

修正手順

  • git管理している場合
    • Cartfile,Cartfile.resolvedに変更がある場合、念のため元に戻す
git checkout (YOUR_PROJECT)/Cartfile
git checkout (YOUR_PROJECT)/Cartfile.resolved
  • 途中までダウンロードが成功したライブラリをすべて削除する (念のため
rm -rf (YOUR_PROJECT)/Carthage/
  • キャッシュを削除する
rm -rf ~/Library/Caches/org.carthage.CarthageKit
  • もう一度、carthage updateをする
carthage update --platform iOS

9
3
0

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
9
3