cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: How to add dropbox-core-sdk java using gradle

How to add dropbox-core-sdk java using gradle

jonpb
Explorer | Level 3
Go to solution

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.

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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?

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

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
Explorer | Level 3
Go to solution

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.

Need more support?