我的Podfile中包含以下行:
pod 'Alamofire', '~> 4.7'
问题是当我添加“ pod SwiftyDropbox”行时,运行pod update时出现问题:
分析依赖性
[!] CocoaPods could not find compatible versions for pod "Alamofire":
In Podfile:
Alamofire (~> 4.7)
SwiftyDropbox was resolved to 2.0.1, which depends on
Alamofire (~> 2.0.2)
此外,Alamofire以及SwiftyDropbox框架中都存在警告。如何获得最新版本的SwiftyDropbox在XCode 9.3和Swift 4中运行?
答案 0 :(得分:0)
SwiftyDropbox文档中未提及的一些事情,但是对于避免/解决此问题来说是必不可少的:
您需要在Podfile中指定SwiftyDropbox的版本。像这样:
pod 'SwiftyDropbox', '~> 5.0.0'
一旦您在Podfile中指定了版本并再次运行pod install
,就会出现此错误:
$ pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "SwiftyDropbox":
In Podfile:
SwiftyDropbox (~> 5.0.0)
None of your spec sources contain a spec satisfying the dependency: `SwiftyDropbox (~> 5.0.0)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
如错误消息所述,您需要手动运行pod repo update
。为什么?谁知道,但您需要这样做。
完成此操作后,它已经获取了SwiftyDropbox的源代码,请运行pod install
,它将在这次运行。输出将包括“ Installing SwiftyDropbox (5.0.0)
”。