首页 > 解决方案 > Carthage:没有可用的 github 版本满足要求(两个框架导入不同版本的 Alamofire)

问题描述

在我的 iOS 应用程序中,我尝试使用 Carthage 导入两个框架——这两个框架都具有 Alamofire 作为依赖项(但版本不同)。

当我运行时,carthage update --platform ios我收到错误:

No available version for github "Alamofire/Alamofire" satisfies the requirement: == 4.7.1

在 iOS 应用程序的 Cartfile 中,我包含了一个私有框架和 AlamofireImage:

git "ssh://git@<url>.com/<repo-name>.git" "<branch-name"
github "Alamofire/AlamofireImage" == 3.3.1

当我进行一些挖掘时,我看到 AlamofireImage 在 Cartfile 中有这个:

github "Alamofire/Alamofire" ~> 4.7

我的私人仓库有github "Alamofire/Alamofire" == 4.7.1

注意:在我的私人仓库中,我的 .gitignore 文件Carthage/Build和.gitignore 文件中都有,Carthage/Checkouts因为它们在 PR 评论中引起了一堆噪音。

Carthage 似乎试图找到 Alamofire 4.7.1 但由于某种原因失败了。到目前为止,我发现的唯一修复是包含github "Alamofire/Alamofire" == 4.7.1在我的 iOS 应用程序的 Cartfile 中......但我不明白为什么 iOS 应用程序本身应该需要了解其依赖项的依赖项。

谢谢!

标签: iosgitalamofirecarthage

解决方案


我最终做的是github "Alamofire/Alamofire" ~> 4.7在我的私有框架仓库中使用github "Alamofire/Alamofire" "4.7.3"并在 iOS 应用程序中使用。现在一切正常。

我也养成了删除 Carthage 缓存的习惯——删除里面的目录~/Library/Caches/org.carthage.CarthageKit/DerivedData


推荐阅读