Hello everyone.
I have a development in B4X that runs without problem in B4A, but not in B4J.
Initially sub drawEAN13 returned (Bitmap), but since B4J doesn't recognize Bitmap, I had to change it to B4XBitmap and with that change it also runs without problem in B4A.
Sub drawEAN13 (data As String, FondoBarras As Int,Barras As Int) As B4XBitmap 'Bitmap
I comment this because in line java, the drawEAN13 procedure is defined as Bitmap
public Bitmap drawEAN13
So it returns a Bitmap
I don't know if this is the source of the error when compiling in B4J
#AdditionalJar: core-3.2.1 is used in B4A and B4J
#AdditionalJar: C:\Android\platforms\android-33\android.jar is used in B4J
I appreciate all the support and suggestions.
I attach sample code
I have a development in B4X that runs without problem in B4A, but not in B4J.
Initially sub drawEAN13 returned (Bitmap), but since B4J doesn't recognize Bitmap, I had to change it to B4XBitmap and with that change it also runs without problem in B4A.
Sub drawEAN13 (data As String, FondoBarras As Int,Barras As Int) As B4XBitmap 'Bitmap
I comment this because in line java, the drawEAN13 procedure is defined as Bitmap
public Bitmap drawEAN13
So it returns a Bitmap
I don't know if this is the source of the error when compiling in B4J
#AdditionalJar: core-3.2.1 is used in B4A and B4J
#AdditionalJar: C:\Android\platforms\android-33\android.jar is used in B4J
Log:
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
Error occurred on line: 17 (EAN13)
java.lang.reflect.InvocationTargetException
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.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
at b4j.example.ean13._drawean13(ean13.java:84)
at b4j.example.b4xmainpage._creacodigobarra(b4xmainpage.java:162)
at b4j.example.b4xmainpage._button1_click(b4xmainpage.java:79)
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.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
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:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA$1.run(BA.java:236)
at com.sun.javafx.application.PlatformImpl.lambda$null$177(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$178(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$152(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
[B]Caused by: java.lang.RuntimeException: Stub![/B]
at android.graphics.Bitmap.createBitmap(Bitmap.java:63)
at b4j.example.ean13.encodeAsBitmap(ean13.java:123)
at b4j.example.ean13.drawEAN13(ean13.java:109)
... 29 more
I appreciate all the support and suggestions.
I attach sample code