Forum Discussion

JeremyConnor's avatar
JeremyConnor
Explorer | Level 4
8 years ago
Solved

Api V1 to V2 migration difficulties

I'm the maintainer for an app with dropbox API v1 integration with about 4000 daily requests to DropBox (has been working well for nearly 2 years and I've been hands free on it). I realise I've got to support V2 in the impending future, and I've been attempting to do just that but I'm having a great deal of trouble getting a hello-world implementation of V2 on android to just work out of the box; it's been surprisingly difficult.

 

In particular I've found triggering the user to authenticate the DropBox App (new instance to support API 2 since File permissions is deprecated) via OAuth to be difficult; the diagrams are great for understanding the flow, but not very helpful as a consumer of the java API.. 

 

I've downloaded the demo application (https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android) and after much fiddling have the android project open and close to running, but I couldn't get the dependency for dropbox-core-sdk to gradle sync, which prevents me running it and getting a better understanding of the workflow, especially around users authenticating my DropBox app to view their content.

 

compile group: 'com.dropbox.core', name: 'dropbox-core-sdk', version: '0-SNAPSHOT', changing: true

 

Replacing the above with this below line doesn't help, as a multitude of classes are not found in the OpenWithActivity class (e.g. DbxOfficialAppConnector, DropboxParseException, DropboxUidNotInitializedException).

 

compile 'com.dropbox.core:dropbox-core-sdk:2.1.1'

I'm sure I've missed something obvious and I know this will be the first step on the V2 road; but any help would be appreciated.

 

Cheers

Jeremy

  • Hi Jeremy, the "0-SNAPSHOT" configuration would be used if you're building the SDK from source locally, but that's not strictly necessary.

     

    You should be able to install a specific version via gradle as you mentioned. In the gradle setup that you posted though, you appear to be trying to load an older version of the SDK (v2.1.1). Can you try the latest version (v3.0.3), as shown here, and let me know if that doesn't help?

     

    https://github.com/dropbox/dropbox-sdk-java#setup

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Hi Jeremy, the "0-SNAPSHOT" configuration would be used if you're building the SDK from source locally, but that's not strictly necessary.

     

    You should be able to install a specific version via gradle as you mentioned. In the gradle setup that you posted though, you appear to be trying to load an older version of the SDK (v2.1.1). Can you try the latest version (v3.0.3), as shown here, and let me know if that doesn't help?

     

    https://github.com/dropbox/dropbox-sdk-java#setup

    • JeremyConnor's avatar
      JeremyConnor
      Explorer | Level 4

      Thank you; much appreciated! It had been a long day; I posted at midnight as I gave up and dragged myself off to bed  :P

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 6 minutes ago
350 Following

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 or Facebook.

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!