Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaFX static SDK for Android fails starting 21-ea+13 #1248

Open
jperedadnr opened this issue Apr 22, 2024 · 0 comments
Open

JavaFX static SDK for Android fails starting 21-ea+13 #1248

jperedadnr opened this issue Apr 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jperedadnr
Copy link
Contributor

Starting JavaFX static SDK 21-ea+13, launching an Android app fails at runtime with:

D/GraalCompiled(  977): Exception in Application start method
D/GraalCompiled(  977): Exception in thread "JavaFX Application Thread" java.lang.UnsatisfiedLinkError: com.sun.javafx.font.FontConfigManager.getFontConfig(Ljava/lang/String;[Lcom/sun/javafx/font/FontConfigManager$FcCompFont;Z)Z [symbol: Java_com_sun_javafx_font_FontConfigManager_getFontConfig or Java_com_sun_javafx_font_FontConfigManager_getFontConfig__Ljava_lang_String_2_3Lcom_sun_javafx_font_FontConfigManager_00024FcCompFont_2Z]
D/GraalCompiled(  977):         at com.oracle.svm.jni.access.JNINativeLinkage.getOrFindEntryPoint(JNINativeLinkage.java:153)
D/GraalCompiled(  977):         at com.oracle.svm.jni.JNIGeneratedMethodSupport.nativeCallAddress(JNIGeneratedMethodSupport.java:52)
D/GraalCompiled(  977):         at com.sun.javafx.font.FontConfigManager.getFontConfig(FontConfigManager.java)
D/GraalCompiled(  977):         at com.sun.javafx.font.FontConfigManager.initFontConfigLogFonts(FontConfigManager.java:159)
D/GraalCompiled(  977):         at com.sun.javafx.font.FontConfigManager.getFontConfigFont(FontConfigManager.java:268)
D/GraalCompiled(  977):         at com.sun.javafx.font.freetype.FTFactory.getFallbacks(FTFactory.java:134)
D/GraalCompiled(  977):         at com.sun.javafx.font.LogicalFont.getLinkedFonts(LogicalFont.java:214)
D/GraalCompiled(  977):         at com.sun.javafx.font.LogicalFont.getNumSlots(LogicalFont.java:223)
D/GraalCompiled(  977):         at com.sun.javafx.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62)
D/GraalCompiled(  977):         at com.sun.javafx.font.LogicalFont.getGlyphMapper(LogicalFont.java:439)
D/GraalCompiled(  977):         at com.sun.javafx.text.GlyphLayout.breakRuns(GlyphLayout.java:229)
D/GraalCompiled(  977):         at com.sun.javafx.text.PrismTextLayout.buildRuns(PrismTextLayout.java:819)
D/GraalCompiled(  977):         at com.sun.javafx.text.PrismTextLayout.layout(PrismTextLayout.java:1070)
D/GraalCompiled(  977):         at com.sun.javafx.text.PrismTextLayout.ensureLayout(PrismTextLayout.java:230)
D/GraalCompiled(  977):         at com.sun.javafx.text.PrismTextLayout.getBounds(PrismTextLayout.java:256)
D/GraalCompiled(  977):         at javafx.scene.text.Text.getLogicalBounds(Text.java:432)
D/GraalCompiled(  977):         at javafx.scene.text.Text.doComputeLayoutBounds(Text.java:1137)
D/GraalCompiled(  977):         at javafx.scene.text.Text$1.doComputeLayoutBounds(Text.java:143)
D/GraalCompiled(  977):         at com.sun.javafx.scene.shape.TextHelper.computeLayoutBoundsImpl(TextHelper.java:95)

The reason for this is https://bugs.openjdk.org/browse/JDK-8246104, that added a fallback implementation that introduced the use of the FontConfigManager into the FTFactory.

FontConfigManager uses a couple of native functions, like
https://github.com/openjdk/jfx/blob/7e2c0d435a46cd4df9fa8d215f2a943d21cab7d9/modules/javafx.graphics/src/main/java/com/sun/javafx/font/FontConfigManager.java#L131

which are provided in
https://github.com/openjdk/jfx/blob/7e2c0d435a46cd4df9fa8d215f2a943d21cab7d9/modules/javafx.graphics/src/main/native-font/fontpath_linux.c, but this file is not included in the Android SDK, which only uses freetype. Therefore the UnsatisfiedLinkError when FTFactory calls getFallbacks.

Expected Behavior

Current Behavior

Steps to Reproduce

Your Environment

@jperedadnr jperedadnr added the bug Something isn't working label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant