cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App 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: 

BadResponseException: Bad JSON

BadResponseException: Bad JSON

Kevin H.27
New member | Level 1

Dear Dropbox Community,

I am using the Dropbox API v2 for my Android app. Lately I have been seeing issues when trying to download a file with client.files().download() where the file does not (yet) exist. Instead of the expected DownloadErrorException, I am getting a BadResponseException (full stack below). I am using the SDK as in compile 'com.dropbox.core:dropbox-core-sdk:2.0.2'

Any ideas?

com.dropbox.core.BadResponseException: Bad JSON: No suitable constructor found for type [simple type, class com.dropbox.core.DbxRequestUtil$ErrorWrapper$ApiErrorResponse<com.dropbox.core.v2.files.DownloadError>]: can not instantiate from JSON object (missing default constructor or creator, or perhaps need to add/enable type information?)
at [Source: buffer(com.android.okhttp.internal.http.HttpConnection$ChunkedSource@87dfad0).inputStream(); line: 1, column: 2]
at com.dropbox.core.v2.DbxRawClientV2$2.execute(DbxRawClientV2.java:157)
at com.dropbox.core.v2.DbxRawClientV2$2.execute(DbxRawClientV2.java:129)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:238)
at com.dropbox.core.v2.DbxRawClientV2.downloadStyle(DbxRawClientV2.java:129)
at com.dropbox.core.v2.files.DbxUserFilesRequests.download(DbxUserFilesRequests.java:258)
at com.dropbox.core.v2.files.DbxUserFilesRequests.download(DbxUserFilesRequests.java:284)
at com.podcatcher.deluxe.model.sync.dropbox.DropboxPodcastListSyncController$DropboxSyncPodcastListTask.getServerSubscriptions(DropboxPodcastListSyncController.java:187)
at com.podcatcher.deluxe.model.sync.dropbox.DropboxPodcastListSyncController$DropboxSyncPodcastListTask.doInBackground(DropboxPodcastListSyncController.java:104)
at com.podcatcher.deluxe.model.sync.dropbox.DropboxPodcastListSyncController$DropboxSyncPodcastListTask.doInBackground(DropboxPodcastListSyncController.java:88)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: No suitable constructor found for type [simple type, class com.dropbox.core.DbxRequestUtil$ErrorWrapper$ApiErrorResponse<com.dropbox.core.v2.files.DownloadError>]: can not instantiate from JSON object (missing default constructor or creator, or perhaps need to add/enable type information?)
at [Source: buffer(com.android.okhttp.internal.http.HttpConnection$ChunkedSource@87dfad0).inputStream(); line: 1, column: 2]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1130)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:298)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:133)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3789)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2863)
at com.dropbox.core.DbxRequestUtil$ErrorWrapper.fromResponse(DbxRequestUtil.java:273)
at com.dropbox.core.v2.DbxRawClientV2$2.execute(DbxRawClientV2.java:152)
... 13 more

 

11 Replies 11

Greg-DB
Dropbox Staff

We have a new release, v2.0.3, that should fix this issue in the SDK itself, so that you'd no longer need that extra ProGuard configuration as a workaround:

https://github.com/dropbox/dropbox-sdk-java/releases/tag/v2.0.3

Kevin H.27
New member | Level 1

Great! Thanks for the fast response. K.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Kevin H.27 New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?