Android Question How to solve loadlayout error?

u2005k

Member
Licensed User
Longtime User
I have some strange problem, we are using Gauge Library (see attachment) in one project it works fine but gives error in another project. Both projects are exactly same... below is error dump...

I am attaching two projects, demo-gauge-not-working.zip contains library files, demo-gauge-working has only B4a project but uses same library.

** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 29 (Main)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at needleview.test.main._activity_create(main.java:383)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:735)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:360)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at needleview.test.main.afterFirstLayout(main.java:104)
at needleview.test.main.access$000(main.java:17)
at needleview.test.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6342)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
Caused by: java.lang.reflect.InvocationTargetException


Please help to resolve this issue.

Thanks a lot
 

Attachments

  • demo-gauge-not-working.zip
    24 KB · Views: 178
  • demo-gauge-working.zip
    294.7 KB · Views: 174

u2005k

Member
Licensed User
Longtime User
Hi Erel,
Sorry... it was not... here it is...
Logger connected to: Xiaomi Redmi Note 4
--------- beginning of main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 29 (Main)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at needleview.test.main._activity_create(main.java:383)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:735)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:360)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at needleview.test.main.afterFirstLayout(main.java:104)
at needleview.test.main.access$000(main.java:17)
at needleview.test.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6342)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
... 18 more
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
at org.codeandmagic.android.gauge.GaugeView.getDefaultOuterRimPaint(GaugeView.java:387)
at org.codeandmagic.android.gauge.GaugeView.initDrawingTools(GaugeView.java:336)
at org.codeandmagic.android.gauge.GaugeView.init(GaugeView.java:292)
at org.codeandmagic.android.gauge.GaugeView.<init>(GaugeView.java:174)
at org.codeandmagic.android.gauge.GaugeView.<init>(GaugeView.java:182)
at gaugeviewrapper.gaugeViewWrapper._initialize(gaugeViewWrapper.java:54)
... 21 more
** Activity (main) Resume **
 
Upvote 0
Top