问题
Here is my Cartfile:
# Kanna HTML parsing library
github "tid-kijyun/Kanna" ~> 1.0.0
# Realm database/ORM
github "realm/realm-cocoa"
When I run carthage update
I get this:
$ carthage --version
Unrecognized command: '--version'. See `carthage help`.
$ carthage update --platform OSX
*** Fetching realm-cocoa
*** Fetching Kanna
*** Skipped downloading realm-cocoa.framework binary due to the error:
"GitHub API request failed: Bad credentials"
*** Checking out realm-cocoa at "v0.98.3"
*** Skipped downloading Kanna.framework binary due to the error:
"GitHub API request failed: Bad credentials"
*** Checking out Kanna at "1.0.5"
*** xcodebuild output can be found in /var/folders/p2/c_d5mx0s3gl45165btrpx1fm0000gn/T/carthage-xcodebuild.KVYEob.log
*** Building scheme "Kanna_OSX" in Kanna.xcworkspace
*** Building scheme "RealmSwift" in RealmExamples.xcworkspace
*** Building scheme "Realm" in RealmExamples.xcworkspace
So it does seem to build both Kanna and Realm, but I'm getting an error about bad GitHub API credentials. What is wrong?
回答1:
I got the solution in response to a Carthage issue I raised:
Edit
~/.gitconfig
and add the following:[credential] helper = osxkeychain [credential "https://github.com"] username = willhains
(Replace
willhains
with your GitHub user ID.)Clone a private repo via HTTPS.
OSX will prompt for your GitHub password.
Run
carthage update
.
回答2:
If you want to skip looking for binaries and just build from source:
carthage update --no-use-binaries
来源:https://stackoverflow.com/questions/35790585/carthage-update-error-github-api-request-failed-bad-credentials