Android Question Caused by: java.lang.Exception: signature does not match expected signature.

Arf

Well-Known Member
Licensed User
Longtime User
I'm getting an exception:
Caused by: java.lang.Exception: Sub Send_Upload signature does not match expected signature.
When calling a sub that is in a service module.

The sub in the service module:
B4X:
Sub Send_Upload(oType As Byte, oData() As Byte)
    Dim oHeader(5) As Byte
    Dim oChk(1) As Byte
    Dim cnt As Int = 0
    Dim sz As Int = 0
   
    sz = oData.Length + 1
    oHeader(0) = -91
    oHeader(1) = 90
    oHeader(2) = sz/256
    oHeader(3) = sz Mod 256
    oHeader(4) = oType
    oChk(0) = Bit.Xor(oChk(0),oType)

    Do While cnt < sz-1
        oChk(0) = Bit.Xor(oChk(0),oData(cnt))
        cnt = cnt + 1
    Loop               
               
    AStream.Write(oHeader)
    If sz > 1 Then
        AStream.Write(oData)
    End If
    AStream.Write(oChk)
End Sub

And the where it is called from my activity:
B4X:
Sub SendUpload
    sendbuf = Serialize(FullUpload)
    CallSub3(Unit_Comms,"Send_Upload", "200","sendbuf")
End Sub
 

stevel05

Expert
Licensed User
Longtime User
Because the sub is expecting the variables to be a byte and a byte array, but you are sending strings.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You are expecting a byte and a bytearray but you are sending two strings.
 
Upvote 0
Top