Scene 3D objects throw exception on Android deivces

Nir Lisker nlisker at gmail.com
Mon Aug 12 07:59:32 UTC 2024


This is not a JavaFX problem. From the stack trace, you're using
javafxports, which is a 3rd party (Gluon) technology. It was EOL years ago
and replaced by their client plugin [1][2]. See https://docs.gluonhq.com on
how to compile JavaFX to mobile.

There is, however, a 3D lighting issue with the OpenGL pipeline that
affects Android, as shown in [3] for example. It's probably something wrong
in the shader, but won't stop your application from running.

- Nir

[1] https://github.com/gluonhq/gluonfx-maven-plugin
[2] https://github.com/gluonhq/gluonfx-gradle-plugin
[3]
https://stackoverflow.com/questions/50163758/issue-with-point-lights-when-on-mobile

On Sun, Aug 11, 2024 at 10:12 AM Ashley Hales <ashley.hales at gmail.com>
wrote:

> Hi, I have been compiling a JavaFX app for Android using the Dalvik SDK. I
> have managed to resolve all the dependencies and compile into an APK. This
> APK will install on Android devices but doesn't work on all of them.
>
> I have modified the HelloWorld app included with the Dalvik SDK to debug
> my problem. It works on all of my devices with just a label on the screen
> but as soon as I add a sphere into the scene it just displays a black
> screen on some devices. I have searched on the internet and suggestions
> indicate that this may be a memory issue but I have tried setting
> android.monocle.stacksize = 12800 in the javafx.platform.properties but
> this has had no effect. After reading other posts on the forum I was
> wondering if this might be due to a lack of 3D support on embedded
> (although this is an Android device).  I have tried modifying
> the javafx.platform.properties by
> setting android.com.sun.javafx.isEmbedded=false or com.sun.javafx.experimental.embedded.3d=true
> but neither have any effect.  I have also tried printing out the result
> of Platform.isSupported(ConditionalFeature.SCENE3D) but confusingly this
> shows true despite the error.
>
> I have tested on a couple of devices so far.  The error occurs every time
> on my MBOX MINIM8S II (Android 6.0.1) but never on my Samsung Galaxy
> Table Model SM-T230 (Android 4.4.2)  device.
>
> I have also shared the compiled APK on Google Drive which you may access
> from
> https://drive.google.com/file/d/1QLA21gg2g9-ODrKctSqac6pNC2cxzCtx/view?usp=drive_link
> .
>
> Here is the logcat report for the issue…
>
> 05-12 09:10:06.584 4053 4181 I ActivityManager: Start proc
> 8921:org.javafxports.helloworld/u0a56 for activity
> org.javafxports.helloworld/javafxports.android.FXActivity
> 05-12 09:10:06.649 8921 8921 I art : Not late-enabling -Xcheck:jni
> (already on)
> 05-12 09:10:06.731 8921 8921 I MultiDex: VM with version 2.1.0 has
> multidex support
> 05-12 09:10:06.731 8921 8921 I MultiDex: install
> 05-12 09:10:06.731 8921 8921 I MultiDex: VM has multidex support, MultiDex
> support library is disabled.
> 05-12 09:10:06.735 8921 8921 V FXActivity: Initializing JavaFX Platform,
> using 8.60.9-SNAPSHOT
> 05-12 09:10:06.745 8921 8921 V FXActivity native: Loading JavaFXDalvik
> library
> 05-12 09:10:06.751 8921 8921 I System.out: usetextureview = false,
> useswipekeyboard = false
> 05-12 09:10:06.753 8921 8921 V FXActivity: onCreate called, using
> 8.60.9-SNAPSHOT
> 05-12 09:10:06.754 8921 8934 V FXActivity native: Notification queue
> instance created.
> 05-12 09:10:06.754 8921 8934 V FXActivity native: Notification queue
> started
> 05-12 09:10:06.758 4172 4172 V PhoneStatusBar: setLightsOn(true)
> 05-12 09:10:06.789 8921 8921 V FXActivity native: appDataDir:
> /data/user/0/org.javafxports.helloworld
> 05-12 09:10:06.790 8921 8921 V FXActivity: onStart
> 05-12 09:10:06.790 8921 8921 V FXActivity: onResume
> 05-12 09:10:06.827 8921 8921 V FXEntity: Surface created.
> 05-12 09:10:06.828 8921 8921 V FXActivity native: [JVDBG] SURFACE created
> native android window at 0xf4a94608, surface = 0xffda7390
> 05-12 09:10:06.970 8921 8921 I System.out: user.locale=en-US
> 05-12 09:10:06.970 8921 8921 I System.out: monocle.stackSize=128000
> 05-12 09:10:06.970 8921 8921 I System.out: prism.text=native
> 05-12 09:10:06.970 8921 8921 I System.out: java.vendor.url=
> http://www.android.com/
> 05-12 09:10:06.970 8921 8921 I System.out: java.ext.dirs=
> 05-12 09:10:06.970 8921 8921 I System.out: line.separator=
> 05-12 09:10:06.970 8921 8921 I System.out: file.encoding=UTF-8
> 05-12 09:10:06.970 8921 8921 I System.out: java.runtime.version=0.9
> 05-12 09:10:06.970 8921 8921 I System.out: prism.dirtyopts=true
> 05-12 09:10:06.970 8921 8921 I System.out: user.name=root
> 05-12 09:10:06.970 8921 8921 I System.out: monocle.input.touchRadius=1
> 05-12 09:10:06.970 8921 8921 I System.out: java.compiler=
> 05-12 09:10:06.970 8921 8921 I System.out: android.icu.unicode.version=7.0
> 05-12 09:10:06.970 8921 8921 I System.out: prism.debugfonts=true
> 05-12 09:10:06.970 8921 8921 I System.out: java.version=0
> 05-12 09:10:06.970 8921 8921 I System.out: android.icu.library.version=55.1
> 05-12 09:10:06.970 8921 8921 I System.out: use.egl=true
> 05-12 09:10:06.971 8921 8921 I System.out: embedded=monocle
> 05-12 09:10:06.971 8921 8921 I System.out: prism.lcdtext=false
> 05-12 09:10:06.971 8921 8921 I System.out: os.arch=armv8l
> 05-12 09:10:06.971 8921 8921 I System.out:
> java.io.tmpdir=/data/user/0/org.javafxports.hellowor...
> 05-12 09:10:06.971 8921 8921 I System.out: glass.platform=Monocle
> 05-12 09:10:06.971 8921 8921 I System.out: android.zlib.version=1.2.8
> 05-12 09:10:06.971 8921 8921 I System.out: user.language=en
> 05-12 09:10:06.971 8921 8921 I System.out: java.vm.version=2.1.0
> 05-12 09:10:06.971 8921 8921 I System.out: com.sun.javafx.isEmbedded=true
> 05-12 09:10:06.971 8921 8921 I System.out: prism.glDepthSize=16
> 05-12 09:10:06.971 8921 8921 I System.out: path.separator=:
> 05-12 09:10:06.971 8921 8921 I System.out: java.runtime.name=Android
> Runtime
> 05-12 09:10:06.971 8921 8921 I System.out: java.specification.version=0.9
> 05-12 09:10:06.971 8921 8921 I System.out: user.dir=/
> 05-12 09:10:06.971 8921 8921 I System.out: prism.maxTextureSize=2048
> 05-12 09:10:06.971 8921 8921 I System.out:
> java.vm.specification.vendor=The Android Project
> 05-12 09:10:06.971 8921 8921 I System.out: java.vm.name=Dalvik
> 05-12 09:10:06.971 8921 8921 I System.out: monocle.platform=Android
> 05-12 09:10:06.971 8921 8921 I System.out: log.lens=FINEST
> 05-12 09:10:06.971 8921 8921 I System.out:
> java.vm.specification.version=0.9
> 05-12 09:10:06.971 8921 8921 I System.out: user.home=
> 05-12 09:10:06.971 8921 8921 I System.out: java.specification.name=Dalvik
> Core Library
> 05-12 09:10:06.971 8921 8921 I System.out: file.separator=/
> 05-12 09:10:06.971 8921 8921 I System.out:
> java.library.path=/vendor/lib:/system/lib
> 05-12 09:10:06.971 8921 8921 I System.out: user.variant=
> 05-12 09:10:06.971 8921 8921 I System.out: os.version=3.14.29
> 05-12 09:10:06.971 8921 8921 I System.out:
> java.boot.class.path=/system/framework/core-libart.jar:/sy...
> 05-12 09:10:06.971 8921 8921 I System.out: DALVIK.prism.verbose=true
> 05-12 09:10:06.971 8921 8921 I System.out: java.vm.specification.name=Dalvik
> Virtual Machine Specification
> 05-12 09:10:06.971 8921 8921 I System.out: javafx.platform=android
> 05-12 09:10:06.971 8921 8921 I System.out: glass.lens=eglfb
> 05-12 09:10:06.971 8921 8921 I System.out: os.name=Linux
> 05-12 09:10:06.971 8921 8921 I System.out: user.region=US
> 05-12 09:10:06.971 8921 8921 I System.out: java.class.path=.
> 05-12 09:10:06.971 8921 8921 I System.out:
> android.icu.impl.ICUBinary.dataPath=/data/misc/zoneinfo/current/icu:/syst...
> 05-12 09:10:06.971 8921 8921 I System.out: prism.verbose=true
> 05-12 09:10:06.971 8921 8921 I System.out: prism.vsync=false
> 05-12 09:10:06.971 8921 8921 I System.out: java.specification.vendor=The
> Android Project
> 05-12 09:10:06.971 8921 8921 I System.out: java.vm.vendor=The Android
> Project
> 05-12 09:10:06.971 8921 8921 I System.out: prism.allowhidpi=false
> 05-12 09:10:06.972 8921 8921 I System.out: java.vendor=The Android Project
> 05-12 09:10:06.972 8921 8921 I System.out: http.agent=Dalvik/2.1.0 (Linux;
> U; Android 6.0.1...
> 05-12 09:10:06.972 8921 8921 I System.out: android.icu.cldr.version=27.0.1
> 05-12 09:10:06.972 8921 8921 I System.out:
> android.openssl.version=BoringSSL
> 05-12 09:10:06.972 8921 8921 I System.out: java.home=/system
> 05-12 09:10:06.972 8921 8921 I System.out: java.vm.vendor.url=
> http://www.android.com/
> 05-12 09:10:06.972 8921 8921 I System.out: java.class.version=50.0
> 05-12 09:10:06.972 8921 8921 V DalvikLauncher: Launch JavaFX application
> on DALVIK vm.
> 05-12 09:10:06.976 8921 8921 V DalvikLauncher: We have JavaFX on our
> current (base) classpath, registered exit listener
> 05-12 09:10:06.978 8921 8921 V DalvikLauncher: application class: [class
> org.javafxports.helloworld.HelloAndroid]
> 05-12 09:10:06.978 8921 8921 V DalvikLauncher: preloader class: [null]
> 05-12 09:10:06.978 8921 8921 V DalvikLauncher: javafx application class:
> [class javafx.application.Application]
> 05-12 09:10:06.978 8921 8921 V DalvikLauncher: javafx launcher class:
> [class com.sun.javafx.application.LauncherImpl]
> 05-12 09:10:06.978 8921 8921 V DalvikLauncher: launch application method:
> [public static void
> com.sun.javafx.application.LauncherImpl.launchApplication(java.lang.Class,java.lang.Class,java.lang.String[])]
> 05-12 09:10:06.979 8921 8921 V FXEntity: Called Surface changed [1280,
> 696], format 4
> 05-12 09:10:06.979 8921 8921 V FXActivity native: [JVDBG] SURFACE created
> native android window at 0xf4a94608, surface = 0xffda7370
> 05-12 09:10:06.980 8921 8921 V FXEntity: Called Surface redraw needed
> 05-12 09:10:06.989 8921 8921 V FXEntity: Called Surface redraw needed
> 05-12 09:10:07.018 4053 4075 I ActivityManager: Displayed
> org.javafxports.helloworld/javafxports.android.FXActivity: +461ms
> 05-12 09:10:07.020 8921 8938 I System.out: Prism pipeline init order: es2
> 05-12 09:10:07.020 8921 8938 I System.out: Using native-based Pisces
> rasterizer
> 05-12 09:10:07.020 8921 8938 I System.out: Using dirty region optimizations
> 05-12 09:10:07.020 8921 8938 I System.out: Using system sized mask for
> primitives
> 05-12 09:10:07.021 8921 8938 I System.out: Not forcing power of 2 sizes
> for textures
> 05-12 09:10:07.021 8921 8938 I System.out: Using hardware CLAMP_TO_ZERO
> mode
> 05-12 09:10:07.021 8921 8938 I System.out: Not opting in for HiDPI pixel
> scaling
> 05-12 09:10:07.026 8921 8939 I System.out: Prism pipeline name =
> com.sun.prism.es2.ES2Pipeline
> 05-12 09:10:07.029 8921 8939 I System.out: Loading ES2 native library ...
> prism_es2_monocle
> 05-12 09:10:07.039 8921 8939 I System.out: succeeded.
> 05-12 09:10:07.040 8921 8939 I System.out: GLFactory using
> com.sun.prism.es2.MonocleGLFactory
> 05-12 09:10:07.052 8921 8939 I GLASS : I have to Call dlopen libGLESv2.so
> 05-12 09:10:07.052 8921 8939 I GLASS : handle = 0xf712dd04
> 05-12 09:10:07.052 8921 8939 I GLASS : I have to Call dlopen libEGL.so
> 05-12 09:10:07.052 8921 8939 I GLASS : handle = 0xf712d9c4
> 05-12 09:10:07.053 8921 8939 I GLASS : Binding to libactivity.so
> 05-12 09:10:07.054 8921 8939 I GLASS : GetNativeWindow = 0xf4ad86dc,
> getDensitiy = 0xf4ad86ec
> 05-12 09:10:07.054 8921 8935 V FXEntity: notify_glassHasStarted called in
> FXActivity. register device now.
> 05-12 09:10:07.072 8921 8939 E libEGL : eglMakeCurrent:800 error 3009
> (EGL_BAD_MATCH)
> 05-12 09:10:07.076 8921 8939 I System.out: (X) Got class = class
> com.sun.prism.es2.ES2Pipeline
> 05-12 09:10:07.077 8921 8939 I System.out: Initialized prism pipeline:
> com.sun.prism.es2.ES2Pipeline
> 05-12 09:10:07.083 8921 8943 I DENSITY : GETDENSITY, answer = 1.000000
> 05-12 09:10:07.097 8921 8939 I System.out: Maximum supported texture size:
> 4096
> 05-12 09:10:07.097 8921 8939 I System.out: Maximum texture size clamped to
> 2048
> 05-12 09:10:07.097 8921 8939 I System.out: Non power of two texture
> support = true
> 05-12 09:10:07.098 8921 8939 I System.out: Maximum number of vertex
> attributes = 16
> 05-12 09:10:07.098 8921 8939 I System.out: Maximum number of uniform
> vertex components = 1024
> 05-12 09:10:07.098 8921 8939 I System.out: Maximum number of uniform
> fragment components = 1024
> 05-12 09:10:07.098 8921 8939 I System.out: Maximum number of varying
> components = 48
> 05-12 09:10:07.098 8921 8939 I System.out: Maximum number of texture units
> usable in a vertex shader = 0
> 05-12 09:10:07.098 8921 8939 I System.out: Maximum number of texture units
> usable in a fragment shader = 8
> 05-12 09:10:07.098 8921 8939 I System.out: Graphics Vendor: ARM
> 05-12 09:10:07.098 8921 8939 I System.out: Renderer: Mali-450 MP
> 05-12 09:10:07.098 8921 8939 I System.out: Version: OpenGL ES 2.0
> 05-12 09:10:07.104 8921 8935 I System.out: register device done
> 05-12 09:10:07.107 8921 8943 W System.err: vsync: false vpipe: true
> 05-12 09:10:07.107 8921 8943 I System.out: [MON] Create device
> 05-12 09:10:07.109 8921 8943 I System.out: [MON] Create device done, add
> done
> 05-12 09:10:07.257 8921 8943 W System.err: Loading FontFactory
> com.sun.javafx.font.freetype.FTFactory
> 05-12 09:10:07.258 8921 8943 W System.err: Subpixel: enabled
> 05-12 09:10:07.272 8921 8943 W System.err: Freetype2 Loaded (version
> 2.10.0)
> 05-12 09:10:07.272 8921 8943 W System.err: LCD support Enabled
> 05-12 09:10:07.302 8921 8943 W art : Before Android 4.1, method void
> com.sun.javafx.scene.transform.TransformUtils$ImmutableTransform.ensureCanTransform2DPoint()
> would have incorrectly overridden the package-private method in
> javafx.scene.transform.Transform
> 05-12 09:10:07.784 8921 8943 W art : Before Android 4.1, method double
> javafx.scene.text.TextFlow.computeChildPrefAreaHeight(javafx.scene.Node,
> javafx.geometry.Insets) would have incorrectly overridden the
> package-private method in javafx.scene.layout.Region
> 05-12 09:10:07.784 8921 8943 W art : Before Android 4.1, method double
> javafx.scene.text.TextFlow.computeChildPrefAreaWidth(javafx.scene.Node,
> javafx.geometry.Insets) would have incorrectly overridden the
> package-private method in javafx.scene.layout.Region
> 05-12 09:10:08.001 8921 8939 I System.out: max rectangle texture cell size
> = 62
> 05-12 09:10:08.019 8921 8939 I System.out: wrap rectangle texture = 2 x 2
> 05-12 09:10:08.024 8921 8939 I System.out: ES2ResourceFactory: Prism -
> createStockShader: AlphaTexture_Color.frag
> 05-12 09:10:08.287 8921 8939 E javafx : Program link log: L0010 Uniform
> 'color' differ on precision
> 05-12 09:10:08.287 8921 8939 W System.err: java.lang.RuntimeException:
> Error creating shader program
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.prism.es2.ES2Shader.createFromSource(ES2Shader.java:158)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.prism.es2.ES2PhongShader.getShader(ES2PhongShader.java:190)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.prism.es2.ES2Context.getPhongShader(ES2Context.java:122)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.prism.es2.ES2Context.renderMeshView(ES2Context.java:451)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.prism.es2.ES2MeshView.render(ES2MeshView.java:119)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.sg.prism.NGShape3D.renderMeshView(NGShape3D.java:179)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.sg.prism.NGShape3D.renderContent(NGShape3D.java:201)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2056)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1948)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:576)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2056)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1948)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:477)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:330)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:278)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
> 05-12 09:10:08.288 8921 8939 W System.err: at
> java.lang.Thread.run(Thread.java:818)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20240812/e1119df7/attachment-0001.htm>


More information about the openjfx-dev mailing list