Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester  here!

Forum Discussion

jonpb's avatar
jonpb
Explorer | Level 3
6 years ago
Solved

How to add dropbox-core-sdk java using gradle

I'm trying to use dropbox in my android app.

 

I realize this is more of a gradle question then a dropbox question. I looked at the gradle docs:

https://docs.gradle.org/current/userguide/userguide.html

and the readme.md:

https://github.com/dropbox/dropbox-sdk-java/blob/master/ReadMe.md

 

I still can't figure how to point gradle to the implementation files required by dropbox-core-sdk. Using:

 

    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.3'

        implementation group: 'com.dropbox.core', name: 'dropbox-core-sdk', version: '0-SNAPSHOT', changing: true
        //implementation 'com.dropbox.core:dropbox-core-sdk:3.1.3'
        //implementation fileTree(dir: 'libs', include: ['*.jar'])
    }

I get the following error:

 

Could not find method implementation() for arguments [{group=com.dropbox.core, name=dropbox-core-sdk, version=0-SNAPSHOT, changing=true}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

 

  • That '0-SNAPSHOT' version of the dependency would be if you're building the SDK from source. That's only really necessary if you need to modify the SDK for some reason.

     

    Otherwise, I recommend just including the pre-built copy of the library as covered here. That's the first line you have commented out in yours. Do you still get an error if you switch to that one?

2 Replies

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

    That '0-SNAPSHOT' version of the dependency would be if you're building the SDK from source. That's only really necessary if you need to modify the SDK for some reason.

     

    Otherwise, I recommend just including the pre-built copy of the library as covered here. That's the first line you have commented out in yours. Do you still get an error if you switch to that one?

  • jonpb's avatar
    jonpb
    Explorer | Level 3
    6 years ago

    Thanks Greg, that's a big help, I was looking for the jar, and skimmed over that download link.

     

    It turns out it was Android Studio (I guess) I created a new app selecting Empty Activity and it didn't setup gradle correctly. I created a new one with Bssic Activity and now it works. Now I just have remove all the UI stuff the template created :)

     

    Thanks.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,037 PostsLatest Activity: 17 hours ago
413 Following

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 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!