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

当我运行 carthage update --platform ios 时出现错误:
No available version for github "Alamofire/Alamofire" satisfies the requirement: == 4.7.1
在 iOS 应用程序的 Cartfile 中,我包含了一个私有(private)框架和 AlamofireImage:
git "ssh://git@<url>.com/<repo-name>.git" "<branch-name"github "Alamofire/AlamofireImage" == 3.3.1
当我进行一些挖掘时,我看到 AlamofireImage 在 Cartfile 中有这个:
github "Alamofire/Alamofire" ~> 4.7
我的私有(private)仓库有 github "Alamofire/Alamofire" == 4.7.1
注意:在我的私有(private)仓库中,我的 .gitignore 文件中有 Carthage/BuildCarthage/Checkouts,因为它们在 PR 评论中引起了一堆噪音。

似乎迦太基正在尝试寻找 Alamofire 4.7.1 但由于某种原因失败了。到目前为止,我找到的唯一解决方法是将 github "Alamofire/Alamofire" == 4.7.1 包含在我的 iOS 应用程序的 Cartfile 中……但我不明白为什么 iOS 应用程序本身需要了解其依赖项的依赖项。

谢谢!

最佳答案

iOS 本身与您使用 carthage 添加的依赖项无关。问题在于您 ( carthage ) 用于每个项目的脚本。 Carthage 使用每个项目配置( 购物车文件 )并且它必须满足要求。

所以如果你想要同一个框架的不同版本( 我根本不推荐它!它浪费了巨大的资源,而且会延长应用程序的午餐时间!并且可能会导致副作用 ),你应该将它们嵌入到每个项目中。

关于ios - Carthage: 没有可用的github版本满足要求(两个框架导入不同版本的Alamofire),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52372108/

10-14 18:50