Android Question B4XPages project Error (SOLVED)

walterf25

Expert
Licensed User
Longtime User
Hi all, this is the first time I try to work with the B4XPages, for some reason I get the following error when I try to compile the B4A project.

Cannot get methods of class: anywheresoftware.b4a.objects.B4XViewWrapper.XUI, disabling cache.
:null,0
java.lang.ClassNotFoundException: anywheresoftware.b4a.objects.B4XViewWrapper.XUI
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.shell.Shell$MethodCache.getMethod(Shell.java:961)
at anywheresoftware.b4a.shell.Shell.getMethod(Shell.java:644)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:731)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at strom.ergonomics.starter.onCreate(starter.java:48)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4940)
at android.app.ActivityThread.access$1900(ActivityThread.java:310)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2300)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.ClassNotFoundException: anywheresoftware.b4a.objects.B4XViewWrapper.XUI
... 21 more

Does anyone know why I get that error, I have the XUI Views library ticked and the ViewsEx library as well.

What am i missing?

Walter
 
Solution
Can you post your project ?
Or a small one showing the problem.
I'll try to upload a project later today, It seems to be a problem with the starter service based on this:
Logger connected to: samsung SM-G975U
--------- beginning of main
Cannot get methods of class: anywheresoftware.b4a.objects.B4XViewWrapper.XUI, disabling cache.
:null,0
java.lang.ClassNotFoundException: anywheresoftware.b4a.objects.B4XViewWrapper.XUI
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.shell.Shell$MethodCache.getMethod(Shell.java:961)
at anywheresoftware.b4a.shell.Shell.getMethod(Shell.java:644)
at...

walterf25

Expert
Licensed User
Longtime User
How did you begin the project in the menu File/Project ?
As a B4XPages project or a 'standard' project.
Did you check the XUI library ?
Yes I started through the Menu File/Project As B4xPages. And yes I also have the XUI library checked as well.
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Can you post your project ?
Or a small one showing the problem.
I'll try to upload a project later today, It seems to be a problem with the starter service based on this:
Logger connected to: samsung SM-G975U
--------- beginning of main
Cannot get methods of class: anywheresoftware.b4a.objects.B4XViewWrapper.XUI, disabling cache.
:null,0
java.lang.ClassNotFoundException: anywheresoftware.b4a.objects.B4XViewWrapper.XUI
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.shell.Shell$MethodCache.getMethod(Shell.java:961)
at anywheresoftware.b4a.shell.Shell.getMethod(Shell.java:644)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:731)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at strom.ergonomics.starter.onCreate(starter.java:48)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4940)
at android.app.ActivityThread.access$1900(ActivityThread.java:310)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2300)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.ClassNotFoundException: anywheresoftware.b4a.objects.B4XViewWrapper.XUI
... 21 more
*** Service (starter) Create ***
java.lang.RuntimeException: Unable to create service strom.ergonomics.starter: java.lang.RuntimeException: java.net.SocketException: Socket closed
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4953)
at android.app.ActivityThread.access$1900(ActivityThread.java:310)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2300)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.RuntimeException: java.net.SocketException: Socket closed
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:177)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at strom.ergonomics.starter.onCreate(starter.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4940)
... 9 more
Caused by: java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:119)
at java.net.SocketInputStream.read(SocketInputStream.java:176)
at java.net.SocketInputStream.read(SocketInputStream.java:144)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:248)
at java.io.BufferedInputStream.read(BufferedInputStream.java:267)
at java.io.DataInputStream.readByte(DataInputStream.java:268)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:344)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
... 12 more

Never had this issue before.

Walter
 
Upvote 0
Solution

walterf25

Expert
Licensed User
Longtime User
Found the problem, I was making use of an XUI variable before the line where it was decayed, stupid mistake, all good now.

I would expect the IDE to catch this mistake and throw an error saying the variable is being used before being declared.
 
Upvote 0
Top