最新想把手里面新做的iOS项目做成swift的来实现, 看自己弄成什么样子, 顺便也就熟悉一下swifit语言之类的,添加 Alamofire 的时候,发现cocoapod 报错:

刚开始我没有注意, 我还以为和原来的提示一样呢. 然后发现不对劲,库没有添加进来,才去仔细查看pod 的信息,发现根本就没有成功! 上面也提示了, To update use : 'gem install cocoapods --pre' ,install命令会升级cocoapods 的 spec仓库,然后我们可以使用以下两种方式来省略这一步:
pod install --verbose --no-repo-update
或者
pod update --verbose --no-repo-update
报错信息:[!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pod being used is: Alamofire
使用上面的命令后, 发现,还是会报错:

在红色的错误里面也提示我们了, 需要在Podfile文件里面添加use_frameworks!,然后像这样:

添加后, 然后使用 pod install命令,就可以了!
网友评论