dropbox/dropbox-sdk-java

NoClassDefFoundError

SF-Sudio opened this issue · 0 comments

I have added dropbox to my gradle dependencies:
implementation 'com.dropbox.core:dropbox-core-sdk:5.4.4'
but trying to upload a file resulting in this error:
java.lang.NoClassDefFoundError: com/dropbox/core/DbxRequestConfig
Caused by: java.lang.ClassNotFoundException: com.dropbox.core.DbxRequestConfig

Code for upload:

    DbxRequestConfig config = DbxRequestConfig.newBuilder("dropbox/Backup").build();
    DbxClientV2 client = new DbxClientV2(config, ACCESS_TOKEN);

    try (InputStream in = new FileInputStream(file)) {
        FileMetadata metadata = client.files().uploadBuilder(filePath).uploadAndFinish(in);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }