Android Question Expected Signature: Is there a way to ....

GuyBooth

Active Member
Licensed User
Longtime User
I have a problem where I am receiving a log message:

B4X:
java.lang.Exception: Sub mp_setvolume_complete signature does not match expected signature.
This is the result of calling back to a code line
B4X:
        Wait for MP_SetVolume_Complete (VolumeSet As Boolean)
Is there any way to determine
1. What was the actual signature "Sent"?
2. What was the "Expected Signature"?
 

GuyBooth

Active Member
Licensed User
Longtime User
Upvote 0

eps

Expert
Licensed User
Longtime User
Surely the issue is you are sending the sub MP_SetVolume_Complete the incorrect data type or that it requires more inputs in order for it to work..

What is the definition of MP_SetVolume_Complete?

You are sending a Boolean - is this all it is expecting?

Are you able to post the code for that subroutine only or at least the definition?

ETA : for instance see here... https://www.b4x.com/android/forum/t...ture-does-not-match-expected-signature.63207/
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User

I don't think it's that simple. I have used Wait For in several ways now, successfully, and I have run into signature issues in the past, and always been able to figure out the problem. This one is different, and looks like it may be related to the callback object - but it doesn't seem to follow the rules.
I've sent a test project to Erel to see what he comes up with.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Hi Guy

Fair enough - although it is a difference in the expected and actual signatures - so something is out of line somewhere... Maybe a library or something?

Are you able to step through the code and easily replicate the issue or won't it build?
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
Hi Guy

Fair enough - although it is a difference in the expected and actual signatures - so something is out of line somewhere...

Which is why I was looking for a way to identify
1. What was the actual signature "Sent"
2. What was the "Expected Signature"
I know what I think I sent.
I know what I think was expected.
Obviously these two don't match with what is actually happening OR there is a bug ... which is why I have asked Erel to take a look.
Usually the "bugs" I find turn out to be my code - but there have been exceptions.
 
Reactions: eps
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
This issue happens in class modules, in debug mode, Wait For was not called and the event was raised.
It is fixed for the next update.

As a workaround you should add an empty sub that will handle the event when Wait For was not called:
B4X:
Sub MP_SetVolume_Complete (VolumeSet As Boolean)
End Sub
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User

I thought I had tested this in version 7.3 Beta, but now I have run into the problem again in the released version 7.3. When I rechecked my code in 7.3 Beta it was still there also. Same code as I reported originally, and adding the empty "dummy" subs makes the problem go away.
Wondering if the "fix" maybe got lost with all the other great code additions ...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…