I've distilled the issue as much as possible and this is it.
If I take the very simple code below and place it into a brand new project I can run that project and use the debugger to step into the DBUtils.InsertMaps Sub.
Now I take that exact same code and place it into my real project. When I attempt to use the debugger to step into the first line of the DBUtils.InsertMaps Sub it crashes every time with the above message.
This is the full error message.
Error occurred on line: 135 (SK_SMR_)
java.lang.NullPointerException: Attempt to read from field 'anywheresoftware.b4a.BA$SharedProcessBA anywheresoftware.b4a.BA.sharedProcessBA' on a null object reference
at anywheresoftware.b4a.B4AClass$ImplB4AClass.getActivityBA(B4AClass.java:20)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:302)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
I'm using B4A 5.02(1) and the B4AShared.jar is dated 6/14/2015 @ 5:50PM.
Now I'm guessing you will tell me to get the latest version so I will do that and append to this if the issue goes away.
If I take the very simple code below and place it into a brand new project I can run that project and use the debugger to step into the DBUtils.InsertMaps Sub.
Now I take that exact same code and place it into my real project. When I attempt to use the debugger to step into the first line of the DBUtils.InsertMaps Sub it crashes every time with the above message.
B4X:
Sub Write_Session_Master_Record(ShowMessages As Boolean) As Boolean
Dim X As SQL
Dim Y As String
Dim Z As List
Try
DBUtils.InsertMaps(X, Y, Z)
Catch
Log(LastException.Message)
ToastMessageShow("Error creating new session",True)
End Try
End Sub
This is the full error message.
Error occurred on line: 135 (SK_SMR_)
java.lang.NullPointerException: Attempt to read from field 'anywheresoftware.b4a.BA$SharedProcessBA anywheresoftware.b4a.BA.sharedProcessBA' on a null object reference
at anywheresoftware.b4a.B4AClass$ImplB4AClass.getActivityBA(B4AClass.java:20)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:302)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
I'm using B4A 5.02(1) and the B4AShared.jar is dated 6/14/2015 @ 5:50PM.
Now I'm guessing you will tell me to get the latest version so I will do that and append to this if the issue goes away.