Bug? xui.CreatePanel causes errors

Alexander Stolte

Expert
Licensed User
Longtime User
Hello,

i use this code:
B4X:
Public Sub CreateCanvas (Width As Int, Height As Int) As B4XCanvas
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, Width, Height)
    Dim cvs As B4XCanvas
    cvs.Initialize(p)
    Return cvs
End Sub

and on:
B4X:
Dim p As B4XView = xui.CreatePanel("")
comes this error:
B4X:
Waiting for debugger to connect...
Program started.
java.lang.NoClassDefFoundError: android/graphics/drawable/Drawable
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:517)
    at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:504)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:252)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:94)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
    at b4j.example.main.start(main.java:38)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: android.graphics.drawable.Drawable
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 23 more
java.lang.RuntimeException: java.lang.NoClassDefFoundError: android/graphics/drawable/Drawable
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:119)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:94)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
    at b4j.example.main.start(main.java:38)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: android/graphics/drawable/Drawable
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:517)
    at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:504)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:252)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:168)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
    ... 12 more
Caused by: java.lang.ClassNotFoundException: android.graphics.drawable.Drawable
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 23 more

in the attachment is a project that show the error
XUI Version: 1.71
 

Attachments

  • Draw.zip
    18.6 KB · Views: 226

stevel05

Expert
Licensed User
Longtime User
It looks like you probably have the Android version of the XUI library in your B4j Additional libraries folder. It is now an internal library so you don't need any version in the additional libraries folder.

Your code works here on B4j.
 
Top