carthage version: 0.19.1, 0.20.1xcodebuild -version: Xcode 8.2.1 Build version 8C1002--no-build? No--no-use-binaries? No--use-submodules? No--cache-builds? No--use-ssh YesCartfile
github <myPrivateRepository>
I have a cartfile in my privateRepository
Cartfile in my repo
github "SwiftyJSON/SwiftyJSON"
github "realm/realm-cocoa"
github "JustHTTP/Just" == 0.5.7
Carthage Output
*** Fetching <myPrivateRepository>
*** Fetching realm-cocoa
*** Fetching OHHTTPStubs
*** Fetching Just
No available version for github "JustHTTP/Just" satisfies the requirement: == 0.5.7
I get this error message of no available version, while when I run carthage update --platform ios in my private repository it can find the version 0.5.7 without any problems.
I previously had version specification for realm as well, and it complained about the available versions too. Also no problem in my private repository.
It looks like carthage is having problem when there is version specification in Cartfile in a dependency?
I can not reproduce the error anymore, I am not sure what was causing this.
I will close this issue for now until I can reproduce this error again.
I made three repositories to reproduce this problem.
ChildRepoA specifies the required version.
github "JustHttp/Just" == 0.5.7
ChildRepoB does not specify the version.
github "JustHTTP/Just"
github "kanekin/ChildRepoA"
github "kanekin/ChildRepoB" "branchA" // Notice this branch specification
And I get the following error:
No available version for github "JustHttp/Just" satisfies the requirement: == 0.5.7
Interesting thing is that it only happens when you specify the branch name in the Cartfile of parent repo. If I use the master branch with the exact same Cartfile, the error does not happen.
Any help would be appreciated.
I resolved the issue by doing this:
If that still not solve the issue. Do the following as well :
If you have same dependencies in several repos with specific version,
make sure you have same specified version on each repos.
Example:
RepoA
dep1 == 2.5.0
dep2 ~> 0.5.7
RepoB
dep1
dep2
RepoC
RepoA
RepoB
fix cartfile on RepoB to have same specified version with RepoA
Hope this help.
@ahmadmuhsink Yes, this will certainly avoid the problem temporarily, but this is just a workaround and not solving the problem permanently.
I see this is an incorrect behaviour of Carthage. When you don't have the control over the sub-dependency, it's impossible to make sure 2 sub-dependencies have the same version specification, which is a use case I believe that Carthage is supposed to support by resolving the versioning properly.
Therefore, I think it's a good idea to fix the fundamental cause on Carthage.
BTW @ahmadmuhsink, Thanks for the work around, I didn't get the error after deleting the stuff in /Users/yourname/Library/Caches/org.carthage.CarthageKit/
Thanks for reducing this to a small example! I'll try to take a look at this soon. It will hopefully be enough for me to create a test case, which makes fixing it remarkably easier.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm noticing this bug as well, with the same setup as the example project (using a branch to specify the version of a child repo). Unfortunately the provided workaround is not working for me either.
Also wondering the state of this. I'm currently on Carthage 0.31.2 but don't see any reason do believe it has been fixed in a later release. Simply by rerunning over and over again, it will eventually work... In my case, I have 2 dependencies that each have Alamofire at 4.8.0 as a subdependency.
Most helpful comment
I resolved the issue by doing this:
If that still not solve the issue. Do the following as well :
If you have same dependencies in several repos with specific version,
make sure you have same specified version on each repos.
Example:
RepoA
dep1 == 2.5.0
dep2 ~> 0.5.7
RepoB
dep1
dep2
RepoC
RepoA
RepoB
fix cartfile on RepoB to have same specified version with RepoA
Hope this help.