Hi all,
some days ago I released the B4J WebGL Library
Now I'm happy to inform all users that I have almost completed writing the WebGL library for B4A.
Almost everything works, already some demos have been tested and works well on Android Emulator, at 50-60 FPS or less depending of the scene complexity.
I don't have a super PC, just a Ryzen7 minipc with integrated Vega 8 1.2Ghz video card, and the emulator consume 50-80% of CPU when render pretty complex full scenes, so this is really promising..... I have not yet tested on physical devices but I will do it soon.
Now, after everything works (almost) I have this big problem.
The library was developed on top of a B4XPages project, with the inline class everything works, but if I compile the class and then import it into
another instance of the IDE creating another new B4XPages project, when I compile I get this error:
And this is the log if I compile in Debug mode:
Please someone know how to get it working ?
As explained, with inline class it works, but after compiling as library it does not works.
I even Jetified the library with Jetifier tool in the B4A IDE.
The problem seem to be the library, not the project code itself, the code is simple and it works with inline class.
If in a new blank B4XPages project I compile without checking in the libraries tab the WebGL library, it compiles a default project template,
if I just check the library in the library tab, without write any code, this error happen.
Thanks for any help
some days ago I released the B4J WebGL Library
Now I'm happy to inform all users that I have almost completed writing the WebGL library for B4A.
Almost everything works, already some demos have been tested and works well on Android Emulator, at 50-60 FPS or less depending of the scene complexity.
I don't have a super PC, just a Ryzen7 minipc with integrated Vega 8 1.2Ghz video card, and the emulator consume 50-80% of CPU when render pretty complex full scenes, so this is really promising..... I have not yet tested on physical devices but I will do it soon.
Now, after everything works (almost) I have this big problem.
The library was developed on top of a B4XPages project, with the inline class everything works, but if I compile the class and then import it into
another instance of the IDE creating another new B4XPages project, when I compile I get this error:
It seem do not find the class where I initialize some stuff in native Java.*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
Initializing WebGL Library ...
Initialize => Parent: anywheresoftware.b4a.BA@73df597
[22:29:51] >>>>>>>> SetupWebChromeClient
java.lang.RuntimeException: java.lang.ClassNotFoundException: b4a.webgl$example$one$webgl$MyWebChromeClient
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1750)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
Caused by: java.lang.ClassNotFoundException: b4a.webgl$example$one$webgl$MyWebChromeClient
at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:289)
at anywheresoftware.b4j.object.JavaObject.InitializeNewInstance(JavaObject.java:84)
at b4a.example.webgl._setupwebchromeclient(webgl.java:3156)
at b4a.example.webgl._initialize(webgl.java:2345)
at b4a.example.b4xmainpage$ResumableSub_Button1_Click.resume(b4xmainpage.java:83)
at anywheresoftware.b4a.keywords.Common$14.run(Common.java:1748)
... 8 more
And this is the log if I compile in Debug mode:
Copying updated assets files (4)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
Error occurred on line: 359 (B4XPagesManager)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1087)
at b4a.webgl.example.one.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:1068)
at b4a.webgl.example.one.b4xpagesmanager._showpage(b4xpagesmanager.java:425)
at b4a.webgl.example.one.b4xpagesmanager._addpage(b4xpagesmanager.java:245)
at b4a.webgl.example.one.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:259)
at b4a.webgl.example.one.b4xpagesmanager._initialize(b4xpagesmanager.java:165)
at b4a.webgl.example.one.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:157)
at b4a.webgl.example.one.main.afterFirstLayout(main.java:105)
at b4a.webgl.example.one.main.access$000(main.java:17)
at b4a.webgl.example.one.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
Caused by: java.lang.RuntimeException: java.lang.Exception: Sub B4XPage_Created signature does not match expected signature.
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285)
... 25 more
Caused by: java.lang.Exception: Sub B4XPage_Created signature does not match expected signature.
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:321)
... 26 more
** Activity (main) Resume **
Please someone know how to get it working ?
As explained, with inline class it works, but after compiling as library it does not works.
I even Jetified the library with Jetifier tool in the B4A IDE.
The problem seem to be the library, not the project code itself, the code is simple and it works with inline class.
If in a new blank B4XPages project I compile without checking in the libraries tab the WebGL library, it compiles a default project template,
if I just check the library in the library tab, without write any code, this error happen.
Thanks for any help
Last edited: