Bug? Unexplicable difference between Debug and release modes.

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
I use last version 6.0 of B4A.
My program connects external devices with Bluetooth, sends commands to them and receives answers from them. It also sends data over Internet. This program cannot be uploaded, mainly because it cannot be run by people not having same devices. It works fine in Debug mode, either connected with B4A-bridge or with a cable.
When run in Release mode (installed on the Tablet), it displays a message that gives no information. I attach the picture of the message.
There is no margin for thinking a mistake of mine, because, as I wrote, in Debug mode it works well. If my mistake exists, it is very subtle (or very basic) and perhaps I cannot trap it.
Attached also the modules and library definition. I use AsyncStreamsText.bas and the libraries indicated in the picture.
 

Attachments

  • b1.jpg
    b1.jpg
    139.5 KB · Views: 211
  • b1.png
    b1.png
    109.9 KB · Views: 272

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi Erel. Thanks for reply, but, no message in the log when debugged with USB Cable connection. Each of my Subs have a Log(name_of_subroutine) inside. I cannot see any error message. (Otherwise it was easy to isolate the mistake, in such a way). Shall I use the "Filter" option on the Log window? Normally I check it. Anyway, even not checking the filter, no error appears (I think that if any exception happens, the relative message should be red colored).
I can attach a log, if helpful.
 

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi. I checked better and, correctly, a message appears. By the way, if I connect with an Usb cable, even using a Release Mode, the IDE makes a debug session. I attach the screen shot of the code involved, along with the Log. As you see, something happens in Astream.Write. For AsyncStreamsText, I trivially used code downloaded by examples.
Thanks for attention.
 

Attachments

  • b2.png
    b2.png
    121.1 KB · Views: 234

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
AND, interestingly, if I connect USB cable, and coherently select "Debug" mode in the IDE.. NO Error message appears.. (see attached screen-shot)
So, I repeat: the error message appears only if I Select Release mode in the IDE and I connect with Cable.
A question that may give an indication: why, in the Log, the message appears twice? perhaps this indicates a mistake that I did?
 

Attachments

  • b3.png
    b3.png
    109 KB · Views: 226

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Putting a Log message inside AsyncStreamsText.bas Write function, the error appears between the Write function and before a New_Data event is raised. It seems to be internal to the two AsyncStreams functions.
 

Attachments

  • b3.png
    b3.png
    164.8 KB · Views: 244

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Final consideration. I resolved the issue taking away all "CallSubDelayed", and substituting them with normal calls. Now the strange message disappeared.
 
Top