Android Question how do you DEBUG - how to DEBUG

vangogh

Active Member
Licensed User
Longtime User
look this
---
Sub btnMyButton_Click

Dim test As Int

test="hello" 'this causaes an error

end sub
----

--- in RELEASE mode:

this make the app crash, WITHOUT any error code, without error line, nothing. it closes.

it's VERY HARD for me to debug "run time" my app, when the user says "the program closed, I don't know what I was doing EXACTLY - I got no error"

older versions of b4a (i had 2.71) had a POWERFUL debugging system, see the image what I got when an error arises


--- in DEBUG mode, with legacy debugger enabled

YES! I get the error, the reason, the line number, the sub involved... YES! (see the -example- attached image, regarding another example error)
very easy to fix the issue!

... but then, in DEBUG mode, if I close the developing ide (I give the apk to the final user), the app crashes immediately after I launch it. immediately. also if there is no error.


I use and OPPO device with android 13
I use "legacy debugger" option - it's VERY useful - if not, the app simply crash. unuseful. legacy debugger is an absolute MUST
... but it doesn't work on release mode, and release mode seems to be mandatory if the b4a IDE is not there

so. What am I missing? HOW to see what error my final user get?


attached, a debug error I saw on b4a version2
thank you
 

Attachments

  • errore debug b4a 2.jpeg
    errore debug b4a 2.jpeg
    151.4 KB · Views: 84

MrKim

Well-Known Member
Licensed User
Longtime User
Has anybody mentioned using a try catch block? I do that and when trying to isolate a problem I add a numeric variable and sprinkle it around with different values, tightening it up until I have found the line.
 
Upvote 0

vangogh

Active Member
Licensed User
Longtime User
Has anybody mentioned using a try catch block? I do that and when trying to isolate a problem I add a numeric variable and sprinkle it around with different values, tightening it up until I have found the line.

yes, of course, but I would have to add, before EVERY line code, a reference to the line number (changing when I modify something) and the line code itself.

.... ad the old debugging method did automatically
not possible when done by hand.

Now I use the application_error sub, that solves the issue to put try catch everywhere... but I miss the line numbers and del line of code

in tricky code section i add

i_am_here = "sub_name, sub_section"
eg
i_am_here = "buttonOK_click, updating_grid"

if an error arise...

sub application_error
msgboxasync("ERROR HERE:" & i_am_here, "error")
end sub

but, as you undestand, in not THE solution we had for free.
 
Last edited:
Upvote 0
Top