Android Question erroneous error msg(s)

67biscuits

Member
Logger connected to: Cat S62 Pro
--------- beginning of crash
--------- beginning of system
--------- beginning of main
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
------------------------------------new order
** Activity (main) Resume **
Error occurred on line: 202 (AnotherDatePicker)
java.lang.RuntimeException: Object should first be initialized (EditText).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.TextViewWrapper.getText(TextViewWrapper.java:36)
at b4a.example.main._cmdsavehoursentry_click(main.java:1154)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)

(I clipped some lines for brevity)

...but...


B4X:
Sub spinProjects
   
    spnExistingProjects.Clear
    spnExistingProjects.Add("Select existing")
    lenAP = 0  
    For Each s As String In AP.ListKeys
        If s = "" Then
            AP.Remove(s)
        End If
        test($"Log Key: ${s}"$)
        spnExistingProjects.Add(s)  
        lenAP = lenAP + 1
    Next
End Sub

In the actual code of my program, line 202 is "End sub"
A few times I have found this. ?
 

67biscuits

Member
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
------------------------------------new order
** Activity (main) Resume **
Error occurred on line: 202 (AnotherDatePicker)
java.lang.RuntimeException: Object should first be initialized (EditText).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.TextViewWrapper.getText(TextViewWrapper.java:36)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:205)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7448)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28309)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7701)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:610)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)


It seems line 202 is arbitrary as line 202 is now something else. I have made no significant changes.
Yes, the error occurs when I hit the aforementioned button [saveHoursEntry_click] event]
Is it referring to line 202 in AnotherdatePicker??

in the meanwhile I shall recheck all the edit boxes suspected of an issue

B4X:
Private Sub cmdSaveHoursEntry_Click
x=x

    Dim he As List = Array As Object(hrsDatePicker.Date, cmdHrsStart.Text, cmdHrsEnd.Text,lblDurationToHours.Text,chkLunch.Checked,txtRate.Text,txtSubtotal.Text,lblHrsTax.Text,txtTotal.text)
x=x
    addEntry(he, hours, clvHours,0)
x=x
End Sub
I've added traps in the module, (X=X is a line break), and yes it happens between the first and second break
 
Upvote 0
Top