Android Question Sub dbxfiles_uploadfinished signature does not match expected signature

Juan Vargas (Bioagro)

Member
Licensed User
Using the Dropbox V2, this is the call
B4X:
  dbxFiles.Upload(Folder,"master.db",FTPMainFolder,False,False)

The completion sub is this, as documented
B4X:
Sub dbxFiles_UploadFinished(success As Boolean, meta As FileMetadata, error As String)
    
End Sub

Then, I get the error

B4X:
UploadErrorException:com.dropbox.core.v2.files.UploadErrorException: Exception in 2/files/upload: {".tag":"path","reason":{".tag":"conflict","conflict":"folder"},"upload_session_id":"pid_upload_session:ABIHLR-LLkmjwHZzYv14SbccQOdsPvTVJWFY2v-qWTIh99nrBw"}
Error occurred on line: 0 (Main)
java.lang.Exception: Sub dbxfiles_uploadfinished signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject com.tropic.invoicefull.main_subs_0._dbxfiles_uploadfinished(anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception

class anywheresoftware.b4a.pc.RemoteObject, class anywheresoftware.b4a.pc.RemoteObject, class anywheresoftware.b4a.pc.RemoteObject, class java.lang.String, class java.lang.String,
java.net.SocketException: Socket closed
    at java.net.SocketInputStream.read(SocketInputStream.java:209)
    at java.net.SocketInputStream.read(SocketInputStream.java:144)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:248)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:267)
    at anywheresoftware.b4a.shell.ShellConnector.readControlData(ShellConnector.java:191)
    at anywheresoftware.b4a.shell.ShellConnector.connect(ShellConnector.java:186)
    at anywheresoftware.b4a.shell.ShellConnector.run(ShellConnector.java:119)
    at java.lang.Thread.run(Thread.java:923)
System.exit called, status: 0
VM exiting with result code 0, cleanup skipped.


What Could it be? I don't have a clue.
 

zed

Active Member
Licensed User
The problem has already been reported.
We need to review the library. If the author doesn't do this, we might need a new library.
The problem when we don't know how to create our own libraries is that we are dependent on others.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
try change it to
B4X:
Sub dbxFiles_UploadFinished(success As Boolean, metaObj As Object, info As String, localpath As String, localfilename As String)
    Dim meta As FileMetadata = metaObj
    Log($"dbxFiles_UploadFinished(${success} Localpath ${localpath} -> Localfilename ${localfilename} -> ${meta})"$)
    Log($"dbxFiles_UploadFinished(${success} Info ${info})"$)
   
End Sub
 
Upvote 0

Juan Vargas (Bioagro)

Member
Licensed User
try change it to
B4X:
Sub dbxFiles_UploadFinished(success As Boolean, metaObj As Object, info As String, localpath As String, localfilename As String)
    Dim meta As FileMetadata = metaObj
    Log($"dbxFiles_UploadFinished(${success} Localpath ${localpath} -> Localfilename ${localfilename} -> ${meta})"$)
    Log($"dbxFiles_UploadFinished(${success} Info ${info})"$)
  
End Sub
Almost there.
No error after upload, just one in line Dim meta as filemetadata, but that is not fatal.

B4X:
Error occurred on line: 32019 (Main)
java.lang.ClassCastException: de.donmanfred.dbxv2.files.FileMetadataWrapper cannot be cast to com.dropbox.core.v2.files.FileMetadata
    at com.tropic.invoicefull.main._dbxfiles_uploadfinished(Unknown Source:68)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
    at anywheresoftware.b4a.BA$2.run(BA.java:395)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:250)
    at android.app.ActivityThread.main(ActivityThread.java:7803)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
null: 3206
 
Upvote 0
Top