I try to run this nice compass app:
https://www.b4x.com/android/forum/threads/compassview-another-compassview.93977/
Whenever program tries to load the layout "main" (line 3)
I get an error message. I have added the libraries to the AdditionalLib folder and "NewCompassView" can be added as a CustomView by the Designer.
So, what do I wrong??
Logger verbunden mit: samsung SM-G928F
--------- beginning of main
Copying updated assets files (11)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 37 (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 JHS.NewCompassView.main._activity_create(main.java:398)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at JHS.NewCompassView.main.afterFirstLayout(main.java:105)
at JHS.NewCompassView.main.access$000(main.java:17)
at JHS.NewCompassView.main$WaitForLayout.run(main.java:83)
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:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
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: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:202)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2968)
at android.content.res.Resources.getLayout(Resources.java:1984)
at android.view.LayoutInflater.inflate(LayoutInflater.java:425)
at edu.arbelkilani.compass.Compass.init(Compass.java:89)
at edu.arbelkilani.compass.Compass.<init>(Compass.java:66)
at newcompassviewwrapper.newcompassviewWrapper._initialize(newcompassviewWrapper.java:81)
... 21 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 37 (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 JHS.NewCompassView.main._activity_create(main.java:398)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at JHS.NewCompassView.main.afterFirstLayout(main.java:105)
at JHS.NewCompassView.main.access$000(main.java:17)
at JHS.NewCompassView.main$WaitForLayout.run(main.java:83)
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:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
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: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:202)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2968)
at android.content.res.Resources.getLayout(Resources.java:1984)
at android.view.LayoutInflater.inflate(LayoutInflater.java:425)
at edu.arbelkilani.compass.Compass.init(Compass.java:89)
at edu.arbelkilani.compass.Compass.<init>(Compass.java:66)
at newcompassviewwrapper.newcompassviewWrapper._initialize(newcompassviewWrapper.java:81)
... 21 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 37 (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 java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
.............................................................
https://www.b4x.com/android/forum/threads/compassview-another-compassview.93977/
Whenever program tries to load the layout "main" (line 3)
B4X:
Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
mbm1.Initialize(File.DirAssets, "ic_needle_2.png")
bmd1.Initialize(mbm1)
ncv1.DegreesColor = Colors.Yellow
ncv1.BorderColor = Colors.White
ncv1.DegreeValueColor = Colors.Red
ncv1.OrientationLabelsColor = Colors.Magenta
ncv1.ShowBorder = True
ncv1.ShowDegreeValue = True
ncv1.ShowOrientationLabels = True
ncv1.DegreesStep = 5
ncv1.Needle = bmd1
I get an error message. I have added the libraries to the AdditionalLib folder and "NewCompassView" can be added as a CustomView by the Designer.
So, what do I wrong??
Logger verbunden mit: samsung SM-G928F
--------- beginning of main
Copying updated assets files (11)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 37 (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 JHS.NewCompassView.main._activity_create(main.java:398)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at JHS.NewCompassView.main.afterFirstLayout(main.java:105)
at JHS.NewCompassView.main.access$000(main.java:17)
at JHS.NewCompassView.main$WaitForLayout.run(main.java:83)
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:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
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: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:202)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2968)
at android.content.res.Resources.getLayout(Resources.java:1984)
at android.view.LayoutInflater.inflate(LayoutInflater.java:425)
at edu.arbelkilani.compass.Compass.init(Compass.java:89)
at edu.arbelkilani.compass.Compass.<init>(Compass.java:66)
at newcompassviewwrapper.newcompassviewWrapper._initialize(newcompassviewWrapper.java:81)
... 21 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 37 (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 JHS.NewCompassView.main._activity_create(main.java:398)
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:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at JHS.NewCompassView.main.afterFirstLayout(main.java:105)
at JHS.NewCompassView.main.access$000(main.java:17)
at JHS.NewCompassView.main$WaitForLayout.run(main.java:83)
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:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
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: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:202)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2968)
at android.content.res.Resources.getLayout(Resources.java:1984)
at android.view.LayoutInflater.inflate(LayoutInflater.java:425)
at edu.arbelkilani.compass.Compass.init(Compass.java:89)
at edu.arbelkilani.compass.Compass.<init>(Compass.java:66)
at newcompassviewwrapper.newcompassviewWrapper._initialize(newcompassviewWrapper.java:81)
... 21 more
** Activity (main) Resume **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 37 (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 java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
.............................................................