Using the following dependencies
<maven-compiler-plugin-version>3.10.1</maven-compiler-plugin-version>
<maven-surefire-plugin-version>3.0.0-M6</maven-surefire-plugin-version>
<javafx-maven-plugin-version>0.0.8</javafx-maven-plugin-version>
<gluonfx-maven-plugin-version>1.0.14</gluonfx-maven-plugin-version>
<java-version>17</java-version>
<javafx-version>19</javafx-version>
<charm-version>6.1.0</charm-version>
<attach-version>4.0.15</attach-version>
with the template POM and graalvm-svm-java17-linux-gluon-22.1.0.1-Final, an pplication can't start if it's using new JavaFX19 API methods. for example:
public class ConsoleView extends View {
ListView<String> console = new ListView<>();
public ConsoleView() {
console.setCellFactory(listView -> {
var cell = new ListCell<String>() {
{
textProperty().bind(itemProperty());
textFillProperty().bind(textProperty().map(text -> {
if (text.contains("RED")) {
return Color.RED;
} else if (text.contains("ORANGE")) {
return Color.ORANGE;
}
return Color.BLACK;
}));
}
};
return cell;
});
setCenter(console);
console.getItems().add("RED");
console.getItems().add("BLUE");
console.getItems().add("GREEN");
console.getItems().add("ORANGE");
}
}
compiles and builds fine (and also runs on desktop fine from the IDE), but when launching on Android the following exception occurs:
D/GraalCompiled( 4642): Exception in thread "JavaFX Application Thread" java.lang.NoSuchMethodError: javafx.beans.property.StringProperty.map(java.util.function.Function)
D/GraalCompiled( 4642): at com.my.view.ConsoleView$1.<init>(ConsoleView.java:29)
D/GraalCompiled( 4642): at com.my.view.ConsoleView.lambda$0(ConsoleView.java:25)
...
The method javafx.beans.property.StringProperty.map is here and is since 19. Since there is no complication and build issue, the method has to have been found. Maybe there is some issue with dynamic linking.
The documentation notes that the the JavaFX version has been bumped to 19-ea+8. Do I need to update something or wait for an update?