Android Question [Solved] B4xDrawer with Xclv errors by adding XUI views 1.86

DroidLyon

Member
Licensed User
Hi all

I am trying to create a large B4x template using entirely XUI components but one prototype errors by simply adding XUI views (1.86) to the projects IDE libraries and then trying to run the codeo_O

The error message is "java.lang.RuntimeException: java.lang.RuntimeException: Field xclv was declared with the wrong type.". I think I understand the "xclv was declared with the wrong type" but I'm positive that it's clearly declared as the correct type in Globals and the designer. The error log then points to line 224 in the B4xDrawer class in code noted below

To narrow down I have created a smaller project using original B4XDrawer - sliding drawer project 1.52 and replaced the listview with a xCustomlistview(1.66) in designer "Left" layout, added Stringutils(1.12) & javaobject(2.05) for the xCustomlistview, and with ViewsEx 1.30, and this works as expected.

However when I add the XUI views lib(1.86) to B4x windows programfiles(86) library folder and then add it into this projects IDE libraries, and then run in either debug or release mode it fails with above error.

I am running B4a 8.8 on an emulator using API 27, windows 10, java. The full error message is as below and the project is attached

As a Noob I expect it's my issue again so apologies (and for length of question) but a clue as to what's wrong would be good ?

Thanks in advance

B4xDrawer class
B4X:
Public Sub getLeftPanel As B4XView
    Return mLeftPanel
End Sub
Error message
B4X:
Copying updated assets files (8)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 224 (B4XDrawer)
java.lang.RuntimeException: java.lang.RuntimeException: Field xclv was declared with the wrong type.
    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:292)
    at b4a.example.main._activity_create(main.java:415)
    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:104)
    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:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6494)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.RuntimeException: Field xclv was declared with the wrong type.
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:431)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
    ... 19 more
** Activity (main) Resume **
 

Attachments

DroidLyon

Member
Licensed User
Apologies I didn't spot this (that xcustomlistview was included as library in 8.30 and at 8.80 it is now at 1.67) :oops:

I can confirm that removing xcustomlistview class and checking xcustomlistview(1.90) library, and reinserting xclv in designer works :)

A few questions though:

Can I confirm whether the intention is that other xui classes mentioned in Guide 1.4 sections 8 & 9 will be deployed as internal libraries at some point or left as classes ?

Is it possible to have xcustomlistview source class updated in tutorial to 1.67 so we can see how it is done & learn, & also allow us to better customise/update our own versions such as the expanding clv used also in now working version attached.

Also I think it would be good to slightly update the xcustomlistview tutorial here as I think this one still shows use of class xcustomlistview 1.51, and example code given uses class 1.20 but no mention of xcustomlistview library ?

Thanks
 

Attachments

Last edited:

Erel

Administrator
Staff member
Licensed User
Can I confirm whether the intention is that other xui classes mentioned in Guide 1.4 sections 8 & 9 will be deployed as internal libraries at some point or left as classes ?
Many views were added to XUI Views library. XUI Views references xCustomListView library. This caused the conflict. Note that you can keep the source code but you will need to modify its name (this is relevant if you want to use a modified version of xCLV).

I've updated the tutorial with a note about the library.

think this one still shows use of class xcustomlistview 1.51
The exact version doesn't matter. The usage is the same.
 

klaus

Expert
Licensed User
Can I confirm whether the intention is that other xui classes mentioned in Guide 1.4 sections 8 & 9 will be deployed as internal libraries at some point or left as classes ?
The examples in chapter 8 Other examples in the B4X CustomViews booklet are examples treated in the B4X CustomViews Booklet they will never be deployed as libraries.
Chapter 9 Other examples from the forum in the B4X CustomViews Booklet, will be updated soon in the next update of the B4X Booklets.
xChart, xGauges and xRotaryKnob exist as classes and now also as B4X Libraries.
 
Last edited:
Top