SwiftyDropbox与Alamofire问题

人气:825 发布:2022-10-16 标签: cocoapods dropbox dropbox-api alamofire swiftydropbox

问题描述

我的Podfile中包含以下行:

I have the following line in my Podfile:

  pod 'Alamofire', '~> 4.7' 

问题是当我添加"pod SwiftyDropbox"行时,当我运行pod update时出现问题:

Problem is when I add the line 'pod SwiftyDropbox', there is an issue when I run 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中运行?

Besides there are warnings in both Alamofire as well as SwiftyDropbox framework. How do I get the latest version of SwiftyDropbox to run in XCode 9.3 and Swift 4?

推荐答案

SwiftyDropbox文档中未提及的一些事情,但对于避免/解决此问题至关重要:

A few things that aren't mentioned in the SwiftyDropbox documentation, but which are essential for avoiding/solving this:

您需要在Podfile中指定SwiftyDropbox的版本.像这样:

You need to specify the version of SwiftyDropbox in the Podfile. Like this:

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 .为什么?谁知道,但您需要这样做.

As the error message says, you need to manually run pod repo update. Why? Who knows, but you need to do it.

完成此操作后,它已经获取了SwiftyDropbox的源代码,请运行 pod install ,它将在这次工作.输出将包括"正在安装SwiftyDropbox(5.0.0)".

Once you've done that, and it has fetched the SwiftyDropbox sources, run pod install and it will work this time. The output will include "Installing SwiftyDropbox (5.0.0)".

940