Forum Discussion

Mark L.45's avatar
Mark L.45
Collaborator | Level 9
10 years ago

Need Alamofire 4.0.0 for swift 3.0

Want to use swiftyDropbox with Swift 3.0 / IOS 10.0

Followed the install instructions, but it downloads the wrong version of Alamofire I suspect.

I think I need 4.0.0 which I can add to a swift 3.0 independently, compile and run. Version 3.3.X that the loads when you do the podfile for SwifyDropbox install won't even compile, gives me dozens of errors.

How to change the podfile to select a more recent copy of Alamofile? 

16 Replies

Replies have been turned off for this discussion
  • Mark L.45's avatar
    Mark L.45
    Collaborator | Level 9
    10 years ago

    Would like to say this was painless and worked... but it wasn't and although I now having got it to compile and work once, just once I find myself with the report.

    precondition failed: A Dropbox client is already authorized: file /Users/localuser/Dropbox/SwiftCode/DBDrop/Carthage/Checkouts/SwiftyDropbox/Source/SwiftyDropbox/SwiftyDropbox_iOS/iOS/OAuthMobile.swift, line 13

    This despite the fact that I delete the app and re-install it again and again. I am sorry I must be your worst nightmare. I try and go back and read the docs, hopefully I missed something.

  • Mark L.45's avatar
    Mark L.45
    Collaborator | Level 9
    10 years ago

    OK, managed to find my way around it, commented out line...

    DropboxClientsManager.authorizeFromController(UIApplication.shared,

                                                              controller: self,

                                                              openURL: { (url: URL) -> Void in

                                                                UIApplication.shared.openURL(url)

                })

    Which of course I am going to need for future clients....  now I find this

    DropboxClientsManager.authorizedClient?.auth.client.accessToken.isEmpty

    in the API which returns true and false.  On a client I have never authenticated in fact it returns "nil", on an authenticated client it returns "false"... can I rely on this?

     

  • @Mark L.: No worries, we're constantly trying to improve the SDK, so it's really helpful hearing your feedback.

    As far as the issue you're having, you can fix it by making a single call to `DropboxClientsManager.unlinkClient()` in your code.

    As of the latest version of SwiftyDropbox, we've removed these cumbersome assert statements, so you can also pull the latest version of SwiftyDropbox with `carthage update`, and that should fix the problem as well.

    Sorry for the inconvenience! Let us know if this solves your problem

  • Wilfried S.'s avatar
    Wilfried S.
    New member | Level 1
    10 years ago

    I tried to create an app using dropbox and I did as described at the GitHub site. the batch file is working find, but when I open de workspace in xCode 8 I get 190 errors at Alamofire. What can I do to fix it. Is there a wrong version of Alamofire? but where I will get the right version? Is it be possible to download it, but where it has to be installed at my computer? 

    Is there anybody who can help me, perhaps someone who was successful in installing the dropbox component. 

    thank you for your help

    Wilfried

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Wilfried, we'll be happy to help with this. Please open a new thread with the details of the issues you've run in to (e.g., the exact steps you followed, and the errors you're getting):

    https://www.dropboxforum.com/hc/en-us/community/posts/new?community_post%5Btopic_id%5D=200209245

    For reference though, since it sounds like maybe this is due to the version of Swift, if you're using Swift 3 in your project, you can should the default master branch of SwiftyDropbox, but if you're using Swift 2.3, you need to use the swift_2_3 branch as documented here.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!