Android Question error persists after I remove offending sub and clean project

Startup

Active Member
Licensed User
Longtime User
I get this error message "Error occurred on line: 0 (B4XDialog) java.lang.Exception: Sub msgbox_result signature does not match expected signature. public static void b4a.example.settings_subs_0._msgbox_result() throws java.lang.Exception class java.lang.Integer,"
so I remove the subs with msgboxes, and I clean the project and close the app and then rerun it and get the same message. Why does this error show after removing all sources for it and what is "line 0" (there is no line 0 in the IDE).
 

drgottjr

Expert
Licensed User
Longtime User
there is more to building than just compiling your module. try removing the reference to the library (since you're not using its dialogs anyway). the error message appears to refer to the library (which is compiled with your app, assuming you haven't already removed it).
by the way, removing the library may throw a different error, which might lead you to something of interest.
 
Upvote 0

Startup

Active Member
Licensed User
Longtime User
there is more to building than just compiling your module. try removing the reference to the library (since you're not using its dialogs anyway). the error message appears to refer to the library (which is compiled with your app, assuming you haven't already removed it).
by the way, removing the library may throw a different error, which might lead you to something of interest.

No I am using the library in a preferences dialog so I can't remove the library.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
bingo! it's being compiled into your project, and something is referring to it (even if not you). whoever you really need to help you in this hasn't seen your post yet. hang in; i'm a little surprised i was the only one who thought it interesting enough to ask you what was going on.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It would be useful if you could zip and post the project that is causing you a problem.
 
Upvote 0

Startup

Active Member
Licensed User
Longtime User
Well, thanks for your interest drgottjr! I'm getting closer to solving this. There are two problems 1. The persistence of the error messages even after the subs with the msgboxs are removed. I think I've solved that by restarting the device. 2. Now I think I know what's causing the problem (creating the error) in the first place. I have two subs being called in sequence .. the first one has a msgboxasync and the second sub has a msgbox2async both have WaitFors. There is no problem when I run the program with just either of the msgboxes alone but when I run both subs I get the error. I think that's due to the Wait Fors returning the code flow to the calling sub such that the Msgbox_Results show up out of sequence and therefore mismatched to the msgboxasync (or msgbox2async). If I eliminate the wait for on the first sub with the msgboxasync then I don't get the error. And thanks stevel05 I'm going to play with this some more before I zip and post the project as I think I'm close to solving it.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
You know you can use a sender filter in your Wait For calls right? Something like:
B4X:
Private Sub Sub1
    Private obj1 as Object = MsgBox2Async(...)
    Wait For (obj1) Msgbox_Result(res as Int)
    ...
End Sub

Private Sub Sub2
    Private obj2 as Object = MsgBox2Async(...)
    Wait For (obj2) Msgbox_Result(res as Int)
    ...
End Sub

- Colin.
 
Upvote 0
Top