You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
afritz a.
8 years agoHelpful | Level 5
Android, uploadBuilder, IllegalArgumentException: Value is null
I have an App named "Android Outliner" with DropBox Api2 integration. One of my customers has an issue while trying to upload a file.
fileMetadata = dbxClientV2
.files()
.uploadBuilder("/" + dropboxDir + "/" + file.getName())
.withAutorename(false)
.withMode(WriteMode.OVERWRITE)
.withMute(false)
.uploadAndFinish(fileInputStream);
...
Dropbox: upload file ... treepad Infoca.hjt Dropbox: Something else went wrong while uploading. java.lang.IllegalArgumentException: Value is null at com.dropbox.core.v2.files.WriteMode.com.dropbox.core.v2.files.WriteMode update(java.lang.String)(SourceFile:170) at at.ff.util.Util.java.lang.String uploadFileToDropbox(android.content.Context,java.lang.String,java.lang.String,java.io.File,java.lang.String,java.lang.String)(SourceFile:745) at at.ff.outliner.SyncTreepad.boolean exportSync(long,java.util.ArrayList)(SourceFile:414) at at.ff.outliner.ActivityList.boolean saveState(boolean)(SourceFile:2667) at at.ff.outliner.ActivityList$SaveStateTask.java.lang.Boolean doInBackground(java.lang.Void[])(SourceFile:2896) at at.ff.outliner.ActivityList$SaveStateTask.java.lang.Object doInBackground(java.lang.Object[])(SourceFile:2848) at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 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) export sync: upload to Dropbox failed null /storage/emulated/0/outliner/sync/treepad/Infoca.hjt
Creating of folders within the "apps" folder works, just uploading files fails.
This happens, even if the user tries with an other dropbox account.
Usually the App-folder, which Outliner is allowed to access, always is
"Apps/outliner".
In the case of this customer it is
"Aplicaciones/outliner".
This is also the folder where Outliner successfully created the subfolders.
The customer's Android Settings as well as the Application language is spanish.
The customer also told me that he uses a Linux desktop with a Dropbox client.
You were completely right, Greg. The user's setting told me that the called code was this one instead of the one I told you in the first post:
fileMetadata = dbxClientV2 .files() .uploadBuilder("/" + dropboxDir + "/" + file.getName()) .withAutorename(true) .withMode(WriteMode.update(oldRevision)) .withMute(false) .uploadAndFinish(fileInputStream);
I did not cleanup everything correctly after the user changed his sync method from another provider to DropBox and did send a wrong oldRevision.
Thanks for the quick feedback and the accurate suggestion.
- Greg-DBDropbox Staff
afritz a. Is that definitely the exact code that is triggering this error? The code shows you using the "overwrite" write mode, but the error mentions the "update" write mode instead.
Also, for reference, the "/Apps" folder name is localized based on the user's account language, but this doesn't affect the API behavior, as app's with the app folder permission don't need to know that app folder root path. The API automatically converts the root path for these apps to be the app folder on the backend.
- afritz a.Helpful | Level 5
- Greg-DBDropbox Staff
Thanks. For example, I was able to reproduce this using:
.withMode(WriteMode.update(null))
The value passed in to WriteMode.update should be the 'rev' value, not null.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 4 hours agoIf 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 or Facebook.
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!