1

I have the following line in my Podfile:

  pod 'Alamofire', '~> 4.7' 

Problem is when I add the line 'pod SwiftyDropbox', there is an issue when I run pod update:

Analyzing dependencies

[!] 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)

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?

4
  • The last SwiftyDropbox (4.6.0) has s.dependency 'Alamofire', '~> 4.5.0', so you should use that Alamofire version. But it's strange that you get the 2.0.1 of SwifityDropbox and not the 4.6.0 one. You shouldn't be able to use different version of the same pod, you need to get a compromise on using the same one.
    – Larme
    Commented Sep 12, 2018 at 13:04
  • [Cross-linking for reference: stackoverflow.com/questions/52295762/… ]
    – Greg
    Commented Sep 12, 2018 at 15:22
  • I need Alamofire 4.7 for Google SignIn. So it doesn't works with this version of Alamofire? Commented Sep 12, 2018 at 17:06
  • Using version 4.5.1 of Alamofire gives 1 warning in Alamofire and 3 warnings in SwiftyDropbox ("Using '!' in this location is deprecated and will be removed in a future release; consider changing this to '?' instead") Commented Sep 12, 2018 at 17:11

1 Answer 1

0

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

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

    pod 'SwiftyDropbox', '~> 5.0.0'
    
  • Once you've specified the version in the Podfile and run pod install again, you'll get this error:

    $ 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.
    
  • As the error message says, you need to manually run pod repo update. Why? Who knows, but you need to do it.

  • 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)".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.