Android Question Error Loading Layout B4XPages

tsteward

Well-Known Member
Licensed User
I am trying to learn B4XPages and multi platform.
I have created the attached example in B4J which works.
I then tried to edit and run the B4A version but have an error when loading MainPage layout.
I think its to do with customlistview but not too sure

Error code
Logger connected to: HUAWEI LYA-L09
--------- beginning of system
--------- beginning of crash
--------- beginning of main
Copying updated assets files (3)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 30 (B4XMainPage)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1055)
at b4a.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:1021)
at b4a.example.b4xpagesmanager._showpage(b4xpagesmanager.java:393)
at b4a.example.b4xpagesmanager._addpage(b4xpagesmanager.java:221)
at b4a.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:235)
at b4a.example.b4xpagesmanager._initialize(b4xpagesmanager.java:159)
at b4a.example.main._activity_create(main.java:408)
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 b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8147)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285)
... 24 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
... 25 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: b4a.example.customlistview
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:311)
at b4a.example.b4xmainpage._b4xpage_created(b4xmainpage.java:78)
... 27 more
Caused by: java.lang.ClassNotFoundException: b4a.example.customlistview
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:454)
at java.lang.Class.forName(Class.java:379)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:389)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:453)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
... 30 more
Caused by: java.lang.ClassNotFoundException: b4a.example.customlistview
... 36 more
** Activity (main) Resume **
Zipper v1.01
Collecting files
Root: C:\Users\locki\Documents\Lara2
Found 24 file(s)
Success. Zip size: 2,334KB
C:\Users\locki\Documents\Project.zip
Completed. Exit code: 0
 

Rubsanpe

Active Member
Licensed User
Have you created the layout for B4A? Layout files are different for each language. You must create the B4A layout by pasting the fields of the B4J version into it.

Ruben
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Yes I have. I thought I attached the project do you could see and hopefully point out what I have missed.
I'll attach it here
 

Attachments

  • Project.zip
    19.7 KB · Views: 41
Upvote 0
Top