Android Question initialise error

dgoss

Member
Licensed User
Longtime User
I'm using tabstrip to do what you do with a tabstrip, but one of my layouts thows the error, Caused by: java.lang.RuntimeException: Object should first be initialized (Label).
Now the problem is I don't know what label is not initialized, I have tried to find the blighter, i've generated members for the whole panel more then once but I still get the error. I've had a look in java file
but all the lines listed pointed to not one label. So a fresh pair of eyes would be appreciated
Posted the file for some kind enough to have a gander.
many thx in advance
PS.
this is the error log I get

** Activity (main) Create, isFirst = true **
** Service (starter) Start **
** Service (starter) Create **
occurred on line: 103 (Main)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Label).Error
at java.lang.reflect.Method.invoke(Method.java:515)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at android.os.Looper.loop(Looper.java:136)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Handler.handleCallback(Handler.java:733)
at b4a.example.main$WaitForLayout.run(main.java:80)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main.afterFirstLayout(main.java:102)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at java.lang.reflect.Method.invoke(Method.java:515)
at java.lang.reflect.Method.invokeNative(Native Method)
at at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247) anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
at java.lang.reflect.Method.invoke(Method.java:515)
at java.lang.reflect.Method.invokeNative(Native Method)
at anywheresoftware.b4a.objects.TabStripViewPager.LoadLayout(TabStripViewPager.java:116)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)
 

Attachments

  • tbStrip.zip
    162.3 KB · Views: 252

mangojack

Expert
Licensed User
Longtime User
Although I can't explain why it is throwing an error ... It is the Label cvTime that is causing the problem.

Removing cvTime (Label) from the layout and remming references in your script allows the app to run without error.

Try removing the Label completely and the declare in globals , then recreate / declare the view from scratch.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is a missing font file (digi.ttf).

I guess that one of the labels is still using it.

You can see it by opening the problematic layout file while a device is connected:

at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:425)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:425)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:144)
... 18 more
** Activity (main) Resume **
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:21)
at anywheresoftware.b4a.designer.DesignerViewsManager$MyMessageHandler$SetProperties.myRun(DesignerViewsManager.java:382)
at anywheresoftware.b4a.designer.DesignerViewsManager$SafeRunnable.run(DesignerViewsManager.java:646)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.RuntimeException: Font not found /data/user/0/anywheresoftware.b4a.designer/files/digi.ttf
at android.graphics.Typeface.createFromFile(Typeface.java:252)
at anywheresoftware.b4a.objects.TextViewWrapper.build(TextViewWrapper.java:151)
at anywheresoftware.b4a.objects.LabelWrapper.build(LabelWrapper.java:35)
... 11 more
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:21)
at anywheresoftware.b4a.designer.DesignerViewsManager$MyMessageHandler$SetProperties.myRun(DesignerViewsManager.java:382)
at anywheresoftware.b4a.designer.DesignerViewsManager$SafeRunnable.run(DesignerViewsManager.java:646)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.RuntimeException: Font not found /data/user/0/anywheresoftware.b4a.designer/files/digi.ttf
at android.graphics.Typeface.createFromFile(Typeface.java:252)
at anywheresoftware.b4a.objects.TextViewWrapper.build(TextViewWrapper.java:151)
at anywheresoftware.b4a.objects.LabelWrapper.build(LabelWrapper.java:35)
... 11 more
 
Upvote 0

dgoss

Member
Licensed User
Longtime User
first of all thank you for taking the time to take a look, the digi.ttf was associated with cvtime (Label)
, after removing the label and re-adding it again all was good,
sometimes you can't see the wood because of the trees.
Again I thank you for your help and support, just needed new eyes on the problem

thread is now closed
 
Upvote 0
Top