Android Question starter service question

DPaul

Active Member
Licensed User
Longtime User
Hi,

I upgraded a week or so ago, to version 8.00, worked fine.(Can't be the problem)
Today, out of the blue, my app won't debug any more.
(Of course it's not my fault, i did not do anything special):)
But maybe i did something inadvertently ?
I would appreciate some help as to where to start looking because i have no clue.
(an older backup will debug though, yes i compared the lines, can't see anything)
Thanks.
This happens at "F5" compilation: (LOG.) 2 errors show up:
-------------------------------------
*** Service (starter) Create ***
** Service (starter) Start **
Error occurred on line: 253 (Main) 'THIS IS JUST A COMMENT LINE
java.lang.RuntimeException: Object should first be initialized (Label).
Did you forget to call Activity.LoadLayout? 'NO I DID NOT
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.TextViewWrapper.setText(TextViewWrapper.java:39)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at b4a.example.main.initializeGlobals(main.java:317)
at b4a.example.main.afterFirstLayout(main.java:101)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7303)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
** Activity (main) Create, isFirst = true **
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
Error occurred on line: 20 (Starter) 'Sub Service_Start (StartingIntent As Intent) IS EMPTY
java.lang.RuntimeException: Object should first be initialized (Label).
Did you forget to call Activity.LoadLayout?
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.TextViewWrapper.setText(TextViewWrapper.java:39)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at b4a.example.main.initializeGlobals(main.java:317)
at b4a.example.main.afterFirstLayout(main.java:101)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7303)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
** Activity (main) Create, isFirst = true **
 

DPaul

Active Member
Licensed User
Longtime User
Hi,
In release mode, i get something different(see below).
The compilation seems to go ok "successfully", but then,
on the tablet i get a message "unfortunately the....has stopped running".
The log gives this text:
-----------------------------
*** Service (starter) Create ***
** Service (starter) Start **
main_globals (java line: 6070) 'my code is only 5000 lines, so this is somewhere else.
java.lang.RuntimeException: Object should first be initialized (Label).
Did you forget to call Activity.LoadLayout?
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.TextViewWrapper.setText(TextViewWrapper.java:39)
at b4a.example.main._globals(main.java:6070)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at b4a.example.main.initializeGlobals(main.java:317)
at b4a.example.main.afterFirstLayout(main.java:101)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7303)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
?
Paul
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Object should first be initialized (Label)

Did you add a label by code without initialzing it? Or a typo (your really load the layout but you address a label you've DIMed by code and renamed it later in the layout or so).

my app won't debug any more

What does that mean exactly? The logs you've posted show that your app is running.

What I would do: Copy the whole project to a NEW folder and strip the code down to a smaller size (comment subs, etc.) until you see what happens. As we have a lot of users with huge projects it must be something with your code. I had the same situation twice but it was always my fault (never think "I did not change a thing, the code is the same"). If there is a problem with B4A V8 then all users here would complain. B4A is tested by the power users here (not me) and they take their biggest projects to do so.
 
Upvote 0

DPaul

Active Member
Licensed User
Longtime User
Hi,

OK, I retraced/undid the last things i remembered doing, on a copied installation.
...
I did add a label via designer, I did generate the Dim statement.
But, then i put some text in (label.text = "abc") in the Globals sub itself,
and that caused all of the problems.:oops:

So my mistake, but the error messages i got where a bit too cryptic to
identify this kind of problem immediately.

Thanks for the help
Paul
 
Upvote 0
Top