I'm attempting to use Carthage to integrate OnePassword and I'm having trouble. The OnePassword extension's master branch does not contain a framework target, but the add-framework-support branch does. The docs state that I can specify a branch to use in my Cartfile, so I made the following Cartfile:
# OnePassword
github "AgileBits/onepassword-app-extension" "add-framework-support"
...but when I attempt to run carthage update I get the following output:
$ carthage update
*** Fetching onepassword-app-extension
Failed to check out repository into /Users/[me]/Library/Caches/org.carthage.CarthageKit/dependencies/onepassword-app-extension: No object named "add-framework-support" exists
I'm using Carthage version 0.6.3. I'm not even sure if this is an issue with Carthage or if I'm doing something wrong. Any help would be greatly appreciated. My attempts to figure this out on my own are chronicled below...
Your Cartfile documentation states the following:
"some-branch-or-tag-or-commit"for a specific Git object (anything allowed by gitrev-parse)
When I make a fresh clone of onepassword-app-extension and I run git rev-parse "add-framework-support" git seems to think it either doesn't exist or there's more than one:
$ git rev-parse "add-framework-support"
add-framework-support
fatal: ambiguous argument 'add-framework-support': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
It's a remote branch:
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/add-framework-support
remotes/origin/add-low-level-api
remotes/origin/feature/org.appextension.fill-browser-action
remotes/origin/improvement/document-change-password
remotes/origin/master
if I checkout add-framework-support, then rev-parse can find it.
$ git checkout add-framework-support
Branch add-framework-support set up to track remote branch add-framework-support from origin.
Switched to a new branch 'add-framework-support'
$ git checkout master
Switched to branch 'master'
$ git rev-parse "add-framework-support"
6c813535439d11941ce3a0cd9d9f5d72406990c6
Assuming that Carthage creates a fresh clone every time, that exercise probably doesn't help much.
Even after a fresh clone, I can run git rev-parse "remotes/origin/add-framework-support" and I get a definitive answer:
$ git rev-parse "remotes/origin/add-framework-support"
6c813535439d11941ce3a0cd9d9f5d72406990c6
Unfortunately, adding "remotes/origin" or "origin/" to my cartfile does not resolve the issue, I get the following output from carthage update:
$ carthage update
*** Fetching onepassword-app-extension
Failed to check out repository into /Users/[me]/Library/Caches/org.carthage.CarthageKit/dependencies/onepassword-app-extension: No object named "remotes/origin/add-framework-support" exists
My git-fu is not that strong, so I may not really understand what rev-parse is doing, and why it's not working with Carthage.
If you mv ~/Library/Caches/org.carthage.CarthageKit/dependencies/onepassword-app-extension ~/.Trash, then carthage update, does it build and exit successfully?
Deleting that folder had no effect. git rev-parse "add-framework-support" in that folder resolves to a commit hash, though. /shrug
If you still can check the output of the post-delete carthage update, does the first line contain Cloning or Fetching?
Maybe the carthage output from a new directory would be helpful as well:
mkdir -p /tmp/carthage-400
cd /tmp/carthage-400
mv ~/Library/Caches/org.carthage.CarthageKit/dependencies/onepassword-app-extension ~/.Trash/onepassword-app-extension-"$RANDOM"
echo 'github "AgileBits/onepassword-app-extension" "add-framework-support"' > Cartfile
carthage update
Yeah, sorry I didn't notice that. After deleting the CarthageKit folder it clones instead of fetches. Still can't find the branch, though. Here's the output:
$ carthage update
*** Cloning onepassword-app-extension
Failed to check out repository into /Users/[me]/Library/Caches/org.carthage.CarthageKit/dependencies/onepassword-app-extension: No object named "add-framework-support" exists
What is your git version. I meet same issue with git 1.7 and 1.8. But no problem with 2.3.2.
Oh, interesting…
I have git version 2.3.7 installed via homebrew.
I'm running into a similar issue with Carthage 0.7.5.
In my Cartfile I was using the github shorthand for the repo:
github "Alamofire/Alamofire" "swift-2.0"
When I changed the declaration to use git and the url, it worked no problem:
git "https://github.com/Alamofire/Alamofire.git" "swift-2.0"
Check if your command line tools points to Xcode 7.0. I could build after changing it.

I was able to fetch a swift-2.3 branch of Alamofire doing
$ cat Cartfile
git "https://github.com/KingOfBrian/Alamofire.git" "feature/Swift2.3"
Then I have instructed to use the right toolchain
$ TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3
$ carthage build
But I get a compilation error
*** xcodebuild output can be found in /var/folders/mm/qbx_84b57sgf_f9j0cxmj__r0000gn/T/carthage-xcodebuild.GRH97R.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
2016-10-28 19:11:42.505 xcodebuild[10175:152845] [MT] PluginLoading: Required plug-in compatibility UUID DA4FDFD8-C509-4D8B-8B55-84A7B66AE701 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64 /LyricsMacExample/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
A shell task (/usr/bin/xcrun xcodebuild -workspace /LyricsMacExample/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace -scheme "Alamofire iOS" -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
2016-10-28 19:11:42.505 xcodebuild[10175:152845] [MT] PluginLoading: Required plug-in compatibility UUID DA4FDFD8-C509-4D8B-8B55-84A7B66AE701 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64 //LyricsMacExample/Carthage/Checkouts/Alamofire/Source/ServerTrustPolicy.swift
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
@loretoparisi Your issues appears to be unrelated. You also haven't shared all the relevant details—in particular what the build error is. I don't think you've properly specified the toolchain. Look at the --toolchain option to Carthage. Otherwise please open a new issue.
Closing this for now.
I'm using Carthage 0.25.0 and I had the same issue with SlackTextViewController. I was using the official repo and now I wanted to switch to a fork with a specific branch.
To solve the issue I just deleted the folder ~/Library/Caches/org.carthage.CarthageKit/dependencies/SlackTextViewController then Carthage cloned the repo again from the new fork.
I can confirm that. Issue still persists with Carthage 0.25.0.
It seems changing the user/organisation of the Github repository has no effect to the reference of the cache.
I also have the same issue when to use both original repo of the dependency and fork in different projects
@lluisgerard @lunij @alickbass Please follow #2143. This is not the issue you are facing.
Most helpful comment
I'm using Carthage
0.25.0and I had the same issue with SlackTextViewController. I was using the official repo and now I wanted to switch to a fork with a specific branch.To solve the issue I just deleted the folder
~/Library/Caches/org.carthage.CarthageKit/dependencies/SlackTextViewControllerthen Carthage cloned the repo again from the new fork.