Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Makro Mikro M.
11 years agoNew member | Level 1
error using DropbBox api v2
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
Replies have been turned off for this discussion
- Greg-DB11 years ago
Dropbox Community Moderator
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.
About 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!