Android Question B4A was not used long ago: error in the OLD projects

peacemaker

Expert
Licensed User
Longtime User
Hi, All

Long ago did not use B4A, tried, re-installed, re-downloaded JDK and SDK, but anyway error:
B4A Version: 13.10
Parsing code. (0.06s)
Java Version: 19
Building folders structure. (0.06s)
Compiling code. (0.16s)
Compiling layouts code. (0.03s)
Organizing libraries. (0.48s)
(AndroidX SDK)
Compiling resources (2.62s)
Linking resources (0.42s)
build tools: 34.0.0, android jar: android-34
Compiling debugger engine code. (2.73s)
Compiling generated Java code. Error
src\peacemaker\vcc\b4xmainpage.java:5: error: package javafx.util does not exist
import javafx.util.Callback;
^
1 error
only showing the first 1 errors, of 7 total; use -Xmaxerrs if you would like to see more

javac 19.0.2

What is forgotten ?

p.s. if to use old JDK 11 - compiled OK, but just at start app - the system msgbox that app is "closed due to error". IDE is not connected to the phone (Samsung Android 14), the MEMU emulator is the same result.

p.s.2: just new default B4XPage project from template - is fully OK. But any existing project with WebView or UltimateWebView - error immediately at start, without error log.
 
Last edited:
Solution
HA ! SOLVED !

"#if java" blocks of the B4J app must be isolated in B4A crossplatform version !

B4X:
 #if B4J

#if java
import javafx.scene.web.*;
import javafx.event.*;
import javafx.util.Callback;  //non-Android classes - must be isolated
...
#End If
#End If

peacemaker

Expert
Licensed User
Longtime User
new default B4XPage project from template - is fully OK
Hmmm, at the new project from template - no error "error: package javafx.util does not exist" if to use JDK 19...

If to delete whole "Objects" folder and re-compile - error with JDK 19 at old projects - anyway is here :(.
-------------

What's wrong in the old projects for the latest B4A and JDK19 ?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
HA ! SOLVED !

"#if java" blocks of the B4J app must be isolated in B4A crossplatform version !

B4X:
 #if B4J

#if java
import javafx.scene.web.*;
import javafx.event.*;
import javafx.util.Callback;  //non-Android classes - must be isolated
...
#End If
#End If
 
Upvote 0
Solution
Top