cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

error using DropbBox api v2

New member | Level 1
New member | Level 1

Hello 

I downloaded the latest sdk using maven :

<dependency>
    <groupId>com.dropbox.core</groupId>
    <artifactId>dropbox-core-sdk</artifactId>
    <version>2.0-beta-1</version>
</dependency>

Then I create a project and I added the following jars:
dropbox-core-sdk-2.0-beta-1.jar
dropbox-core-sdk-1.7.7.jar
dropbox-core-sdk-0-SNAPSHOT.jar
jackson-core-2.2.4.jar
jackson-databind-2.7.0-SNAPSHOT.jar

And then i tried to run the following example using a valid token:

 

DbxRequestConfig config = new DbxRequestConfig("dropbox/java-tutorial", "en_US");

        DbxClientV2 client = new DbxClientV2(config, ACCESS_TOKEN);

        try {

Users.FullAccount account = client.users.getCurrentAccount();

System.out.println("account "+account.email);

} catch (DbxException e) {

System.out.println(e.getMessage());

}

And I encountered the following error:

Exception in thread "main" java.lang.NoSuchFieldError: VoidReader

at com.dropbox.core.v2.Users.getCurrentAccount(Users.java:1403)

at dropbox.DropBox.gread(DropBox.java:18)

at dropbox.DropBox.main(DropBox.java:28)

 Can you tell me what I am doing wrong. The token is good for v1 sdk api.

Best Regards,

Aurelian

 

 

1 Reply 1
Highlighted

Re: error using DropbBox api v2

Dropboxer
Dropboxer

It looks like you also have an old version of the SDK added:

dropbox-core-sdk-1.7.7.jar

Can you remove that and try again? Also, try the "account-info" example that's included with the SDK.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?