cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
In need of some #MondayMotivation? Read more

Android, uploadBuilder, IllegalArgumentException: Value is null

SOLVED
166 Views
4 Comments
0 Kudos
Highlighted
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:284smiling face with sunglasses 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:58smiling face with sunglasses at java.lang.Thread.run(Thread.java:81smiling face with sunglasses 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.
 
 
 
1 Accepted solution

Accepted Solutions
Solution
Level 5

Re: Android, uploadBuilder, IllegalArgumentException: Value is null

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.

 

4 Replies
Dropboxer

Re: Android, uploadBuilder, IllegalArgumentException: Value is null

@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.

 

 

Level 5

Re: Android, uploadBuilder, IllegalArgumentException: Value is null


Greg K. wrote:

@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. 

 

 

Thanks for the reply.

I will check this but have to ask the customer about a Setting. I will tell you.

Dropboxer

Re: Android, uploadBuilder, IllegalArgumentException: Value is null

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.

Solution
Level 5

Re: Android, uploadBuilder, IllegalArgumentException: Value is null

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.