Android Question Null receiver error

mterveen

Member
Licensed User
Longtime User
i get the error below sporadically when i first send data to a bluetooth device and get a response back. the message says the error occurred on line xxx, which is an "end sub" line!!! i need help trying to figure out the error message and what is really happening. thanks.

***Error Message***

connection status: true
** Service (btlogger) Create **
** Service (btlogger) Start **

Error occurred on line: 351 (BTLogger)
java.lang.NullPointerException: null receiver
at java.lang.reflect.Field.get(Native Method)
at java.lang.reflect.Field.get(Field.java:279)
at anywheresoftware.b4a.shell.Shell.getStateAfterUserSubHelper(Shell.java:512)
at anywheresoftware.b4a.shell.Shell.getStateAfterUserSub(Shell.java:495)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:402)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA$2.run(BA.java:328)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)


***BTLogger Service***

line 190: Sub AStream_NewData (Buffer() As Byte)
....various routines
line 351: End Sub 'Error ????????????????
 

mterveen

Member
Licensed User
Longtime User
the latest version. i'll compile in release mode and try it this weekend. again, it happens inconsistently. the service is started immediately on a successful connection to the bluetooth module (which happens immediately on program startup). perhaps there is some delay that is necessary before i try to interact with the BT module. however, i am monitoring the communications on the bluetooth side (and also with a saleae logic analyzer) and it does get the data being sent via astreams.write2 but the b4a program fails on receipt of the bytes requested from the bluetooth module. does the error message above indicate in any way what line of code is causing the issue? or does it point to the "End Sub" line by default because it is some time of "generic" error?

i'll see if i can find a routine to make it fail consistently.
 
Upvote 0
Top