2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

carthage update で "Bad credentials" になった時の対応

Last updated at Posted at 2020-06-17

経緯

久しぶりにcarthage updateしたら "Bad credentials" で少しハマった。

cartfile
github "Krimpedance/KRProgressHUD" == 3.4.0
github "SwiftyJSON/SwiftyJSON" == 4.2.0
github "Alamofire/Alamofire" ~> 4.4
github "TheLevelUp/ZXingObjC" == 3.5.0
github "ashleymills/Reachability.swift" == 4.3.0
$ carthage update --platform iOS                                                                            
Please update to the latest Carthage version: 0.34.0. You currently are on 0.33.0
*** Fetching KRProgressHUD
*** Fetching Reachability.swift
*** Fetching ZXingObjC
*** Fetching SwiftyJSON
*** Fetching Alamofire
*** Fetching KRActivityIndicatorView
*** Checking out KRActivityIndicatorView at "3.0.0" 
*** Checking out Alamofire at "4.9.1" 
*** Checking out SwiftyJSON at "4.2.0" 
*** Checking out ZXingObjC at "3.5.0" 
*** Checking out Reachability.swift at "v4.3.0" 
*** Checking out KRProgressHUD at "3.4.0" 
*** xcodebuild output can be found in /var/folders/zc/578tdlfj5y5_63cwhc1kb6ww0000gn/T/carthage-xcodebuild.DsvTh0.log
*** Skipped downloading Alamofire.framework binary due to the error:
    "Bad credentials" 
*** Skipped downloading KRActivityIndicatorView.framework binary due to the error:
    "Bad credentials" 
*** Skipped downloading KRProgressHUD.framework binary due to the error:
    "Bad credentials" 
*** Skipped downloading Reachability.swift.framework binary due to the error:
    "Bad credentials" 
*** Skipped downloading ZXingObjC.framework binary due to the error:
    "Bad credentials" 
*** Skipped downloading SwiftyJSON.framework binary due to the error:
    "Bad credentials" 
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
*** Building scheme "KRActivityIndicatorView" in KRActivityIndicatorView.xcodeproj
*** Building scheme "KRProgressHUD" in KRProgressHUD.xcodeproj
*** Building scheme "Reachability" in Reachability.xcodeproj
*** Building scheme "SwiftyJSON iOS" in SwiftyJSON.xcworkspace
*** Building scheme "iOS Framework" in ZXingObjC.xcodeproj

原因

GitHub credential でミスってるようだ。
https://stackoverflow.com/questions/39578496/carthage-error-bad-credentials

以前、Githubのアカウント名を変更したのだが、Keychainを確認したら、古いアカウント名で登録されたままだった。

解決方法

  1. ~/gitconfigにGitHub credential情報を記載する。
    or
  2. KeychainからGitHub credential formを削除する。

↓を参考に2の方法をやってみる。
https://help.github.com/ja/github/using-git/updating-credentials-from-the-osx-keychain

結果

再度実行。 "Bad credentials" が出なかった。

$ carthage update --platform iOS                                                                 
Please update to the latest Carthage version: 0.34.0. You currently are on 0.33.0
*** Fetching Alamofire
*** Fetching Reachability.swift
*** Fetching ZXingObjC
*** Fetching KRProgressHUD
*** Fetching SwiftyJSON
*** Fetching KRActivityIndicatorView
*** Checking out SwiftyJSON at "4.2.0" 
*** Checking out KRActivityIndicatorView at "3.0.0" 
*** Checking out KRProgressHUD at "3.4.0" 
*** Checking out ZXingObjC at "3.5.0" 
*** Checking out Reachability.swift at "v4.3.0" 
*** Checking out Alamofire at "4.9.1" 
*** xcodebuild output can be found in /var/folders/zc/578tdlfj5y5_63cwhc1kb6ww0000gn/T/carthage-xcodebuild.J6U96V.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
*** Building scheme "KRActivityIndicatorView" in KRActivityIndicatorView.xcodeproj
*** Building scheme "KRProgressHUD" in KRProgressHUD.xcodeproj
*** Building scheme "Reachability" in Reachability.xcodeproj
*** Building scheme "SwiftyJSON iOS" in SwiftyJSON.xcworkspace
*** Building scheme "iOS Framework" in ZXingObjC.xcodeproj

参考

https://stackoverflow.com/questions/39578496/carthage-error-bad-credentials
https://help.github.com/ja/github/using-git/updating-credentials-from-the-osx-keychain

2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?