webfx-project / webfx-cli

The Command Line Interface for WebFX. The terminal tool for developing WebFX applications.
https://webfx.dev
Apache License 2.0
9 stars 3 forks source link

Running WebFX sample app on Android produces a black screen #4

Open amischler opened 1 year ago

amischler commented 1 year ago

I built and installed the WebFX example app on a Samsung Galaxy S7 Edge with Android 8.0.0.

The app starts but displays only a black screen. Any idea about what is going wrong?

Please find the Android logs below :

03-01 14:33:46.553  2263  2263 V GraalActivity: onCreate start, using Android Logging v1
03-01 14:33:46.577  2263  2263 V GraalActivity: onCreate done
03-01 14:33:46.578  2263  2263 V GraalActivity: onStart
03-01 14:33:46.578  2263  2263 V GraalActivity: onStart done
03-01 14:33:46.580  2263  2263 V GraalActivity: onResume
03-01 14:33:46.580  2263  2263 V GraalActivity: onResume done
03-01 14:33:46.639  2263  2263 V GraalActivity: surfaceCreated for com.gluonhq.helloandroid.MainActivity@9a3e711
03-01 14:33:46.639  2263  2263 V GraalActivity: loading substrate library
03-01 14:33:46.746  2263  2263 E GraalGluon: AndroidVM called JNI_OnLoad, vm = 0x7b5e6cf300, androidEnv = 0x7b5e6d6200
03-01 14:33:46.746  2263  2263 V GraalActivity: loaded substrate library
03-01 14:33:46.746  2263  2263 E GraalGluon: nativeSetSurface called, env at 0x7b5e6d6200 and size 8, surface at 0x7fef31b3e8
03-01 14:33:46.746  2263  2263 E GraalGluon: native setSurface Ready, native window at 0x7b4bd31010
03-01 14:33:46.747  2263  2263 V GraalActivity: metrics = DisplayMetrics{density=3.0, width=1080, height=1920, scaledDensity=3.0, xdpi=403.4115, ydpi=399.73724}, density = 3.0
03-01 14:33:46.747  2263  2263 E GraalGluon: SurfaceReady, surface at 0x7fef31b3c8
03-01 14:33:46.748  2263  2263 E GraalGluon: SurfaceReady, native window at 0x7b4bd31010
03-01 14:33:46.748  2263  2263 V GraalActivity: Surface created, native code informed about it, nativeWindow at 529553100816
03-01 14:33:46.748  2263  2263 V GraalActivity: We will now launch Graal in a separate thread
03-01 14:33:46.750  2263  2263 V GraalActivity: graalStarted true
03-01 14:33:46.750  2263  2263 V GraalActivity: surfaceCreated done
03-01 14:33:46.750  2263  2295 E GraalGluon: Start GraalApp, DALVIK env at 0x7b4bc81300
03-01 14:33:46.750  2263  2295 E GraalGluon: PAGESIZE = 4096
03-01 14:33:46.750  2263  2295 E GraalGluon: EnvVersion = 65542
03-01 14:33:46.750  2263  2295 E GraalGluon: calling JavaMainWrapper_run with argsize: 23
03-01 14:33:46.750  2263  2263 V GraalActivity: [MainActivity] surfaceChanged, format = 4, width = 1080, height = 1848
03-01 14:33:46.750  2263  2263 E GraalGluon: nativeSetSurface called, env at 0x7b5e6d6200 and size 8, surface at 0x7fef31b3f8
03-01 14:33:46.750  2263  2263 E GraalGluon: native setSurface Ready, native window at 0x7b4bd31010
03-01 14:33:46.751  2263  2263 V GraalActivity: surfaceChanged done, metrics = DisplayMetrics{density=3.0, width=1080, height=1920, scaledDensity=3.0, xdpi=403.4115, ydpi=399.73724}, density = 3.0
03-01 14:33:46.751  2263  2263 V GraalActivity: SurfaceRedraw needed: ask native graal layer to redraw surface
03-01 14:33:46.751  2263  2263 E GraalGluon: launcher, nativeSurfaceRedrawNeeded called. Invoke method on glass_monocle
03-01 14:33:46.752  2263  2263 V GraalActivity: surfaceredraw needed part 1 done
03-01 14:33:46.754  2263  2263 D GraalActivity: onCreateInputConnection
03-01 14:33:46.757  2263  2294 D GraalCompiled: ***************************************************
03-01 14:33:46.757  2263  2294 D GraalCompiled: ***** Booting webfx-example-application-gluon *****
03-01 14:33:46.757  2263  2294 D GraalCompiled: ***************************************************
03-01 14:33:46.757  2263  2294 D GraalCompiled: Booting 2 application modules in the following order:
03-01 14:33:46.757  2263  2294 D GraalCompiled: 1) webfx-platform-boot (jobs starter) (boot level 7)
03-01 14:33:46.757  2263  2294 D GraalCompiled: 2) webfx-kit-launcher (boot level 9)
03-01 14:33:46.757  2263  2294 D GraalCompiled:
03-01 14:33:46.757  2263  2294 D GraalCompiled: >>>>> Booting 1) webfx-platform-boot (jobs starter) with ApplicationJobsBooter <<<<<
03-01 14:33:46.757  2263  2294 D GraalCompiled: 0 provided application jobs:
03-01 14:33:46.757  2263  2294 D GraalCompiled: >>>>> Booting 2) webfx-kit-launcher with WebFxKitLauncherModuleBooter <<<<<
03-01 14:33:46.758  2263  2294 D GraalCompiled: Prism pipeline init order: es2
03-01 14:33:46.758  2263  2294 D GraalCompiled: Using Double Precision Marlin Rasterizer
03-01 14:33:46.758  2263  2294 D GraalCompiled: Using dirty region optimizations
03-01 14:33:46.758  2263  2294 D GraalCompiled: Using system sized mask for primitives
03-01 14:33:46.758  2263  2294 D GraalCompiled: Not forcing power of 2 sizes for textures
03-01 14:33:46.758  2263  2294 D GraalCompiled: Using hardware CLAMP_TO_ZERO mode
03-01 14:33:46.758  2263  2294 D GraalCompiled: Opting in for HiDPI pixel scaling
03-01 14:33:46.759  2263  2294 D GraalCompiled: Prism pipeline name = com.sun.prism.es2.ES2Pipeline
03-01 14:33:46.759  2263  2294 D GraalCompiled: Loading ES2 native library ... prism_es2_monocle
03-01 14:33:46.762  2263  2294 D GraalCompiled:     succeeded.
03-01 14:33:46.762  2263  2294 D GraalCompiled: GLFactory using com.sun.prism.es2.MonocleGLFactory
03-01 14:33:46.765  2263  2294 D GraalCompiled: In JNI_OnLoad_glass)monocle
03-01 14:33:46.770  2263  2294 D GraalCompiled: (X) Got class = class com.sun.prism.es2.ES2Pipeline
03-01 14:33:46.770  2263  2294 D GraalCompiled: Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline
03-01 14:33:46.771  2263  2294 D GraalCompiled: ***********************************************************
03-01 14:33:46.771  2263  2294 D GraalCompiled: ***** webfx-example-application-gluon booted in 18 ms *****
03-01 14:33:46.771  2263  2294 D GraalCompiled: ***********************************************************
03-01 14:33:46.774  2263  2294 D GraalCompiled: Mar 01, 2023 2:33:46 PM com.sun.javafx.application.PlatformImpl startup
03-01 14:33:46.774  2263  2294 D GraalCompiled: WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @71c7db30'
03-01 14:33:46.782  2263  2294 D GraalCompiled: Maximum supported texture size: 8192
03-01 14:33:46.782  2263  2294 D GraalCompiled: Maximum texture size clamped to 4096
03-01 14:33:46.782  2263  2294 D GraalCompiled: Non power of two texture support = true
03-01 14:33:46.782  2263  2294 D GraalCompiled: Maximum number of vertex attributes = 16
03-01 14:33:46.782  2263  2294 D GraalCompiled: Maximum number of uniform vertex components = 4096
03-01 14:33:46.782  2263  2294 D GraalCompiled: Maximum number of uniform fragment components = 4096
03-01 14:33:46.782  2263  2294 D GraalCompiled: Maximum number of varying components = 60
03-01 14:33:46.782  2263  2294 D GraalCompiled: Maximum number of texture units usable in a vertex shader = 16
03-01 14:33:46.782  2263  2294 D GraalCompiled: Maximum number of texture units usable in a fragment shader = 16
03-01 14:33:46.782  2263  2294 D GraalCompiled: Graphics Vendor: ARM
03-01 14:33:46.782  2263  2294 D GraalCompiled:        Renderer: Mali-T880
03-01 14:33:46.782  2263  2294 D GraalCompiled:         Version: OpenGL ES 3.2 v1.r22p0-01rel0.df0c07f7ff7915d24119c5461f72cc26
03-01 14:33:46.782  2263  2294 D GraalCompiled:  vsync: true vpipe: true
03-01 14:33:46.784  2263  2301 D GraalGluon: ATTACH_DALVIK, tid = 2301, existed? 0, dalvikEnv at 0x7b4bc81f00
03-01 14:33:46.785  2263  2301 D GraalGluon: ATTACH_DALVIK, tid = 2301, existed? 1, dalvikEnv at 0x7b4bc81f00
03-01 14:33:46.786  2263  2301 D GraalGluon: DETACH_DALVIK, tid = 2301, existed = 1, env at 0x7b4bc81f00
03-01 14:33:46.786  2263  2263 D GraalActivity: onCreateInputConnection
03-01 14:33:46.786  2263  2301 D GraalGluon: ATTACH_DALVIK, tid = 2301, existed? 1, dalvikEnv at 0x7b4bc81f00
03-01 14:33:46.852  2263  2263 E GraalGluon: launcher, nativeSurfaceRedrawNeeded called. Invoke method on glass_monocle
03-01 14:33:46.865  2263  2263 V GraalActivity: surfaceredraw needed (and wait) done
03-01 14:34:36.201  2263  2294 D GraalCompiled: don't add points, primary = -1
03-01 14:34:38.686  2263  2263 V GraalActivity: onPause
03-01 14:34:38.686  2263  2263 E GraalGluon: Dispatching lifecycle event from native Dalvik layer: pause
03-01 14:34:38.686  2263  2263 D GraalGluon: ATTACH_DALVIK, tid = 2263, existed? 1, dalvikEnv at 0x7b5e6d6200
03-01 14:34:38.687  2263  2263 D GraalGluon: ATTACH_GRAAL, tid = 2263, existed? 1, graalEnv at 0x7b51b1e980
03-01 14:34:38.787  2263  2263 D GraalGluon: DETACH_GRAAL, tid = 2263, graalVM = 0x7b3ad17460, existed = 1, env at 0x7b51b1e980
03-01 14:34:38.787  2263  2263 D GraalGluon: DETACH_DALVIK, tid = 2263, existed = 1, env at 0x7b5e6d6200
03-01 14:34:38.798  2263  2263 W System.err: [MainGraalActivity] surfaceDestroyed
03-01 14:34:38.798  2263  2263 E GraalGluon: nativeSetSurface called, env at 0x7b5e6d6200 and size 8, surface at 0x0
03-01 14:34:38.798  2263  2263 E GraalGluon: native setSurface was null
03-01 14:34:38.799  2263  2263 V GraalActivity: onStop
03-01 14:34:38.800  2263  2263 E GraalGluon: Dispatching lifecycle event from native Dalvik layer: stop
03-01 14:34:38.800  2263  2263 D GraalGluon: ATTACH_DALVIK, tid = 2263, existed? 1, dalvikEnv at 0x7b5e6d6200
03-01 14:34:38.800  2263  2263 D GraalGluon: DETACH_DALVIK, tid = 2263, existed = 1, env at 0x7b5e6d6200
03-01 14:34:41.263  2263  2263 V GraalActivity: onRestart
03-01 14:34:41.263  2263  2263 E GraalGluon: Dispatching lifecycle event from native Dalvik layer: restart
03-01 14:34:41.263  2263  2263 D GraalGluon: ATTACH_DALVIK, tid = 2263, existed? 1, dalvikEnv at 0x7b5e6d6200
03-01 14:34:41.263  2263  2263 D GraalGluon: DETACH_DALVIK, tid = 2263, existed = 1, env at 0x7b5e6d6200
03-01 14:34:41.282  2263  2263 V GraalActivity: onStart
03-01 14:34:41.282  2263  2263 E GraalGluon: Dispatching lifecycle event from native Dalvik layer: start
03-01 14:34:41.282  2263  2263 D GraalGluon: ATTACH_DALVIK, tid = 2263, existed? 1, dalvikEnv at 0x7b5e6d6200
03-01 14:34:41.283  2263  2263 D GraalGluon: DETACH_DALVIK, tid = 2263, existed = 1, env at 0x7b5e6d6200
03-01 14:34:41.283  2263  2263 V GraalActivity: onStart done
03-01 14:34:41.283  2263  2263 V GraalActivity: onResume
03-01 14:34:41.283  2263  2263 E GraalGluon: Dispatching lifecycle event from native Dalvik layer: resume
03-01 14:34:41.283  2263  2263 D GraalGluon: ATTACH_DALVIK, tid = 2263, existed? 1, dalvikEnv at 0x7b5e6d6200
03-01 14:34:41.283  2263  2263 D GraalGluon: DETACH_DALVIK, tid = 2263, existed = 1, env at 0x7b5e6d6200
03-01 14:34:41.284  2263  2263 V GraalActivity: onResume done
03-01 14:34:41.301  2263  2263 V GraalActivity: surfaceCreated for com.gluonhq.helloandroid.MainActivity@9a3e711
03-01 14:34:41.301  2263  2263 V GraalActivity: loading substrate library
03-01 14:34:41.302  2263  2263 V GraalActivity: loaded substrate library
03-01 14:34:41.302  2263  2263 E GraalGluon: nativeSetSurface called, env at 0x7b5e6d6200 and size 8, surface at 0x7fef31b3e8
03-01 14:34:41.302  2263  2263 E GraalGluon: native setSurface Ready, native window at 0x7b4bd33010
03-01 14:34:41.302  2263  2263 V GraalActivity: metrics = DisplayMetrics{density=3.0, width=1080, height=1920, scaledDensity=3.0, xdpi=403.4115, ydpi=399.73724}, density = 3.0
03-01 14:34:41.302  2263  2263 E GraalGluon: SurfaceReady, surface at 0x7fef31b3c8
03-01 14:34:41.302  2263  2263 E GraalGluon: SurfaceReady, native window at 0x7b4bd33010
03-01 14:34:41.303  2263  2263 V GraalActivity: Surface created, native code informed about it, nativeWindow at 529553109008
03-01 14:34:41.303  2263  2263 V GraalActivity: GraalApp is already started.
03-01 14:34:41.303  2263  2263 V GraalActivity: surfaceCreated done
03-01 14:34:41.303  2263  2263 V GraalActivity: [MainActivity] surfaceChanged, format = 4, width = 1080, height = 1848
03-01 14:34:41.303  2263  2263 E GraalGluon: nativeSetSurface called, env at 0x7b5e6d6200 and size 8, surface at 0x7fef31b3f8
03-01 14:34:41.303  2263  2263 E GraalGluon: native setSurface Ready, native window at 0x7b4bd33010
03-01 14:34:41.304  2263  2263 V GraalActivity: surfaceChanged done, metrics = DisplayMetrics{density=3.0, width=1080, height=1920, scaledDensity=3.0, xdpi=403.4115, ydpi=399.73724}, density = 3.0
03-01 14:34:41.304  2263  2263 V GraalActivity: SurfaceRedraw needed: ask native graal layer to redraw surface
03-01 14:34:41.304  2263  2263 E GraalGluon: launcher, nativeSurfaceRedrawNeeded called. Invoke method on glass_monocle
03-01 14:34:41.304  2263  2263 V GraalActivity: surfaceredraw needed part 1 done
03-01 14:34:41.306  2263  2263 D GraalActivity: onCreateInputConnection
03-01 14:34:41.404  2263  2263 E GraalGluon: launcher, nativeSurfaceRedrawNeeded called. Invoke method on glass_monocle
03-01 14:34:41.404  2263  2263 V GraalActivity: surfaceredraw needed (and wait) done
03-01 14:34:42.873  2263  2263 V GraalActivity: onPause
03-01 14:34:42.873  2263  2263 E GraalGluon: Dispatching lifecycle event from native Dalvik layer: pause
03-01 14:34:42.873  2263  2263 D GraalGluon: ATTACH_DALVIK, tid = 2263, existed? 1, dalvikEnv at 0x7b5e6d6200
03-01 14:34:42.873  2263  2263 D GraalGluon: ATTACH_GRAAL, tid = 2263, existed? 1, graalEnv at 0x7b51b1e980
03-01 14:34:42.974  2263  2263 D GraalGluon: DETACH_GRAAL, tid = 2263, graalVM = 0x7b3ad17460, existed = 1, env at 0x7b51b1e980
03-01 14:34:42.974  2263  2263 D GraalGluon: DETACH_DALVIK, tid = 2263, existed = 1, env at 0x7b5e6d6200
03-01 14:34:47.348  2263  2263 D GraalActivity: onCreateInputConnection
03-01 14:34:47.351  2263  2263 V GraalActivity: onResume
03-01 14:34:47.392  2263  2263 D GraalGluon: ATTACH_DALVIK, tid = 2263, existed? 1, dalvikEnv at 0x7b5e6d6200
03-01 14:34:47.392  2263  2263 D GraalGluon: DETACH_DALVIK, tid = 2263, existed = 1, env at 0x7b5e6d6200
03-01 14:34:47.392  2263  2263 V GraalActivity: onResume done
03-01 14:35:01.366  2263  2263 V GraalActivity: onPause
03-01 14:35:01.366  2263  2263 E GraalGluon: Dispatching lifecycle event from native Dalvik layer: pause
03-01 14:35:01.366  2263  2263 D GraalGluon: ATTACH_DALVIK, tid = 2263, existed? 1, dalvikEnv at 0x7b5e6d6200
03-01 14:35:01.366  2263  2263 D GraalGluon: ATTACH_GRAAL, tid = 2263, existed? 1, graalEnv at 0x7b51b1e980
03-01 14:35:01.467  2263  2263 D GraalGluon: DETACH_GRAAL, tid = 2263, graalVM = 0x7b3ad17460, existed = 1, env at 0x7b51b1e980
03-01 14:35:01.468  2263  2263 D GraalGluon: DETACH_DALVIK, tid = 2263, existed = 1, env at 0x7b5e6d6200
03-01 14:35:01.507  2263  2263 W System.err: [MainGraalActivity] surfaceDestroyed
03-01 14:35:01.507  2263  2263 E GraalGluon: nativeSetSurface called, env at 0x7b5e6d6200 and size 8, surface at 0x0
03-01 14:35:01.507  2263  2263 E GraalGluon: native setSurface was null
03-01 14:35:01.508  2263  2263 V GraalActivity: onStop
03-01 14:35:01.508  2263  2263 E GraalGluon: Dispatching lifecycle event from native Dalvik layer: stop
03-01 14:35:01.516  2263  2263 D GraalGluon: DETACH_DALVIK, tid = 2263, existed = 1, env at 0x7b5e6d6200
03-01 14:35:02.339  2263  2263 V GraalActivity: onDestroy
03-01 14:35:02.339  2263  2263 E GraalGluon: Dispatching lifecycle event from native Dalvik layer: destroy
03-01 14:35:02.339  2263  2263 D GraalGluon: ATTACH_DALVIK, tid = 2263, existed? 1, dalvikEnv at 0x7b5e6d6200
03-01 14:35:02.339  2263  2263 D GraalGluon: DETACH_DALVIK, tid = 2263, existed = 1, env at 0x7b5e6d6200
amischler commented 1 year ago

Some additional logs filtering logcat on "webfx" :

03-01 14:40:48.497  4258  4288 D GraalCompiled: ***** Booting webfx-example-application-gluon *****
03-01 14:40:48.497  4258  4288 D GraalCompiled: 1) webfx-platform-boot (jobs starter) (boot level 7)
03-01 14:40:48.497  4258  4288 D GraalCompiled: 2) webfx-kit-launcher (boot level 9)
03-01 14:40:48.497  4258  4288 D GraalCompiled: >>>>> Booting 1) webfx-platform-boot (jobs starter) with ApplicationJobsBooter <<<<<
03-01 14:40:48.497  4258  4288 D GraalCompiled: >>>>> Booting 2) webfx-kit-launcher with WebFxKitLauncherModuleBooter <<<<<
03-01 14:40:48.501  4960  9420 V InputMethodManagerService: windowGainedFocus : reason=WINDOW_FOCUS_GAIN client=android.os.BinderProxy@c518eda inputContext=com.android.internal.view.IInputContext$Stub$Proxy@2084001 missingMethods= attribute=android.view.inputmethod.EditorInfo@2c9bea6 nm = org.example.webfxexampleapplicationgluon controlFlags=#105 softInputMode=#130 windowFlags=#81810100
03-01 14:40:48.504  4960  6541 V WindowManager: Relayout Window{b32d1e8 u0 org.example.webfxexampleapplicationgluon/com.gluonhq.helloandroid.MainActivity}: viewVisibility=0 req=1080x1920 WM.LayoutParams{(0,0)(fillxfill) sim=#30 ty=1 fl=#81810100 pfl=0x20000 fmt=1 wanim=0x10302fd vsysui=0x600 needsMenuKey=2 colorMode=0 naviIconColor=0}
03-01 14:40:48.510  4258  4288 D GraalCompiled: ***** webfx-example-application-gluon booted in 16 ms *****
03-01 14:40:48.539  4258  4294 F zygote64: java_vm_ext.cc:504]   native: #08 pc 00000000015b7218  /data/app/org.example.webfxexampleapplicationgluon-kL-y9FQhxMOtZZT8EnwDVw==/lib/arm64/libsubstrate.so (registerDalvikClass+448)
03-01 14:40:48.539  4258  4294 F zygote64: java_vm_ext.cc:504]   native: #09 pc 00000000015b8474  /data/app/org.example.webfxexampleapplicationgluon-kL-y9FQhxMOtZZT8EnwDVw==/lib/arm64/libsubstrate.so (initializeLifecycleDalvikHandles+44)
03-01 14:40:48.539  4258  4294 F zygote64: java_vm_ext.cc:504]   native: #10 pc 00000000015b8080  /data/app/org.example.webfxexampleapplicationgluon-kL-y9FQhxMOtZZT8EnwDVw==/lib/arm64/libsubstrate.so (JNI_OnLoad_lifecycle+132)
03-01 14:40:48.539  4258  4294 F zygote64: java_vm_ext.cc:504]   native: #11 pc 000000000019aaa8  /data/app/org.example.webfxexampleapplicationgluon-kL-y9FQhxMOtZZT8EnwDVw==/lib/arm64/libsubstrate.so (JNILibraryInitializer_callOnLoadFunction_7833a452cbe2b969eec248ff45fd5fe129f3cbdc+104)
03-01 14:40:48.539  4960  9420 V WindowManager: finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING Window{b32d1e8 u0 org.example.webfxexampleapplicationgluon/com.gluonhq.helloandroid.MainActivity} in Surface(name=org.example.webfxexampleapplicationgluon/com.gluonhq.helloandroid.MainActivity)
03-01 14:40:48.540  4258  4258 V InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@24ee34d nm : org.example.webfxexampleapplicationgluon ic=com.gluonhq.helloandroid.MainActivity$InternalSurfaceView$1@f666e02
03-01 14:40:48.546  4960  5133 D ViewRootImpl@a0f5182[webfxexampleapplicationgluon]: dispatchDetachedFromWindow
03-01 14:40:48.546  4960  5133 D InputEventReceiver: channel '370b8d0 Splash Screen org.example.webfxexampleapplicationgluon (client)' ~ Disposing input event receiver.
03-01 14:40:48.546  4960  5133 D InputEventReceiver: channel '370b8d0 Splash Screen org.example.webfxexampleapplicationgluon (client)' ~NativeInputEventReceiver.
03-01 14:40:48.551  4960  5066 I ActivityManager: Displayed org.example.webfxexampleapplicationgluon/com.gluonhq.helloandroid.MainActivity: +231ms
03-01 14:40:48.571  3207  3207 D SurfaceFlinger:       GLES | 00000000 | 0000 | 0220 | 00 | 0105 | ? ffffffff  |    0.0,    0.0,   -1.0,   -1.0 |   13,   90, 1078, 1912 | Background for - SurfaceView - org.example.webfxexampleapplicationgluon/com.g
03-01 14:40:48.571  3207  3207 D SurfaceFlinger:       GLES | 71d94ea240 | 0000 | 0000 | 00 | 0105 | RGBA_8888   |    0.0,    0.0, 1080.0,   72.0 |   13,   19, 1078,   90 | org.example.webfxexampleapplicationgluon/com.gluonhq.helloandroid.MainActivity#0
03-01 14:40:48.571  3207  3207 D SurfaceFlinger:       GLES | 71ddc75680 | 0000 | 0020 | 00 | 0105 | RGBA_8888   |    0.0,    0.0, 1080.0, 1920.0 |   13,   19, 1078, 1912 | Splash Screen org.example.webfxexampleapplicationgluon#0
03-01 14:40:48.648  4960  5133 I WindowManager: Destroying surface Surface(name=Splash Screen org.example.webfxexampleapplicationgluon) called by com.android.server.wm.WindowStateAnimator.destroySurface:2501 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:985 com.android.server.wm.WindowState.destroyOrSaveSurfaceUnchecked:3680 com.android.server.wm.WindowState.destroySurface:3628 com.android.server.wm.AppWindowToken.destroySurfaces:722 com.android.server.wm.AppWindowToken.destroySurfaces:706 com.android.server.wm.WindowState.onExitAnimationDone:5335 com.android.server.wm.WindowStateAnimator.stepAnimationLocked:550
03-01 14:40:48.649  3207  3299 I SurfaceFlinger: id=8638 Removed Splash Screen org.example.webfxexampleapplicationgluon#0 (3/7)
03-01 14:40:48.658  3207  3207 D SurfaceFlinger:       GLES | 00000000 | 0000 | 0220 | 00 | 0105 | ? ffffffff  |    0.0,    0.0,   -1.0,   -1.0 |    0,   72, 1080, 1920 | Background for - SurfaceView - org.example.webfxexampleapplicationgluon/com.gluonhq.helloandroid.MainActivity@9a3e711@0#0
03-01 14:40:48.658  3207  3207 D SurfaceFlinger:        HWC | 71d94ea240 | 0000 | 0000 | 00 | 0105 | RGBA_8888   |    0.0,    0.0, 1080.0,   72.0 |    0,    0, 1080,   72 | org.example.webfxexampleapplicationgluon/com.gluonhq.helloandroid.MainActivity#0
03-01 14:40:48.663  3207  4700 I SurfaceFlinger: id=8638 Removed Splash Screen org.example.webfxexampleapplicationgluon#0 (-2/7)
03-01 14:40:48.664  3207  3207 I Layer   : id=8638 onRemoved Splash Screen org.example.webfxexampleapplicationgluon#0
03-01 14:40:48.684  3207  3207 D SurfaceFlinger:       GLES | 00000000 | 0000 | 0220 | 00 | 0105 | ? ffffffff  |    0.0,    0.0,   -1.0,   -1.0 |    0,   72, 1080, 1920 | Background for - SurfaceView - org.example.webfxexampleapplicationgluon/com.gluonhq.helloandroid.MainActivity@9a3e711@0#0
03-01 14:40:48.684  3207  3207 D SurfaceFlinger:        HWC | 71d94ea240 | 0000 | 0000 | 00 | 0105 | RGBA_8888   |    0.0,    0.0, 1080.0,   72.0 |    0,    0, 1080,   72 | org.example.webfxexampleapplicationgluon/com.gluonhq.helloandroid.MainActivity#0
03-01 14:40:48.814  4960  5179 D MdnieScenarioControlService:  packageName : org.example.webfxexampleapplicationgluon    className : com.gluonhq.helloandroid.MainActivity
03-01 14:40:54.341  4960  7569 D GameManagerService: identifyGamePackage. org.example.webfxexampleapplicationgluon
salmonb commented 1 year ago

Not sure what's happening, as there is no crash according to the logs...

Can you try installing one of our already compiled demos to see what's happening? For example the Tally Counter: https://github.com/webfx-demos/webfx-demo-tallycounter/releases Expand the Assets folder, download and install the apk file on your device, and let me know if it's working.

amischler commented 1 year ago

Thank you for the feedback. The Tally Counter apk is working fine.

I did some further testing :

java -jar webfx-example-application-openjfx-1.0.0-SNAPSHOT-fat.jar
*****************************************************
***** Booting webfx-example-application-openjfx *****
*****************************************************
Booting 2 application modules in the following order:
1) webfx-platform-boot (jobs starter) (boot level 7)
2) webfx-kit-launcher (boot level 9)

>>>>> Booting 1) webfx-platform-boot (jobs starter) with ApplicationJobsBooter <<<<<
0 provided application jobs:
>>>>> Booting 2) webfx-kit-launcher with WebFxKitLauncherModuleBooter <<<<<
Graphics Device initialization failed for :  es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
    at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:268)
    at com.sun.javafx.perf.PerformanceTracker.logEvent(PerformanceTracker.java:100)
    at javafx.scene.Node.<clinit>(Node.java:418)
    at dev.webfx.kit.launcher.spi.impl.openjfx.JavaFxWebFxKitLauncherProvider.<init>(JavaFxWebFxKitLauncherProvider.java:121)
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484)
    at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789)
    at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
    at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
    at dev.webfx.platform.util.serviceloader.SingleServiceProvider$ServiceInfo.getProvider(SingleServiceProvider.java:114)
    at dev.webfx.platform.util.serviceloader.SingleServiceProvider$ServiceInfo.getProxy(SingleServiceProvider.java:121)
    at dev.webfx.platform.util.serviceloader.SingleServiceProvider.getProvider(SingleServiceProvider.java:70)
    at dev.webfx.platform.util.serviceloader.SingleServiceProvider.getProvider(SingleServiceProvider.java:63)
    at dev.webfx.kit.launcher.WebFxKitLauncher.getProvider(WebFxKitLauncher.java:23)
    at dev.webfx.kit.launcher.WebFxKitLauncher.launchApplication(WebFxKitLauncher.java:29)
    at dev.webfx.kit.launcher.WebFxKitLauncherModuleBooter.bootModule(WebFxKitLauncherModuleBooter.java:27)
    at dev.webfx.platform.boot.spi.impl.ApplicationModuleBooterManager.callModules(ApplicationModuleBooterManager.java:77)
    at dev.webfx.platform.boot.spi.impl.ApplicationModuleBooterManager.bootModules(ApplicationModuleBooterManager.java:37)
    at dev.webfx.platform.boot.spi.impl.ApplicationModuleBooterManager.initialize(ApplicationModuleBooterManager.java:25)
    at dev.webfx.platform.boot.spi.ApplicationBooterProvider.boot(ApplicationBooterProvider.java:13)
    at dev.webfx.platform.boot.ApplicationBooter.start(ApplicationBooter.java:40)
    at dev.webfx.platform.boot.ApplicationBooter.main(ApplicationBooter.java:44)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.base/java.lang.Thread.run(Thread.java:1589)
Exception in thread "main" java.util.ServiceConfigurationError: dev.webfx.kit.launcher.spi.WebFxKitLauncherProvider: Provider dev.webfx.kit.launcher.spi.impl.openjfx.JavaFxWebFxKitLauncherProvider could not be instantiated
    at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586)
    at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:813)
    at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
    at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
    at dev.webfx.platform.util.serviceloader.SingleServiceProvider$ServiceInfo.getProvider(SingleServiceProvider.java:114)
    at dev.webfx.platform.util.serviceloader.SingleServiceProvider$ServiceInfo.getProxy(SingleServiceProvider.java:121)
    at dev.webfx.platform.util.serviceloader.SingleServiceProvider.getProvider(SingleServiceProvider.java:70)
    at dev.webfx.platform.util.serviceloader.SingleServiceProvider.getProvider(SingleServiceProvider.java:63)
    at dev.webfx.kit.launcher.WebFxKitLauncher.getProvider(WebFxKitLauncher.java:23)
    at dev.webfx.kit.launcher.WebFxKitLauncher.launchApplication(WebFxKitLauncher.java:29)
    at dev.webfx.kit.launcher.WebFxKitLauncherModuleBooter.bootModule(WebFxKitLauncherModuleBooter.java:27)
    at dev.webfx.platform.boot.spi.impl.ApplicationModuleBooterManager.callModules(ApplicationModuleBooterManager.java:77)
    at dev.webfx.platform.boot.spi.impl.ApplicationModuleBooterManager.bootModules(ApplicationModuleBooterManager.java:37)
    at dev.webfx.platform.boot.spi.impl.ApplicationModuleBooterManager.initialize(ApplicationModuleBooterManager.java:25)
    at dev.webfx.platform.boot.spi.ApplicationBooterProvider.boot(ApplicationBooterProvider.java:13)
    at dev.webfx.platform.boot.ApplicationBooter.start(ApplicationBooter.java:40)
    at dev.webfx.platform.boot.ApplicationBooter.main(ApplicationBooter.java:44)
Caused by: java.lang.ExceptionInInitializerError
    at dev.webfx.kit.launcher.spi.impl.openjfx.JavaFxWebFxKitLauncherProvider.<init>(JavaFxWebFxKitLauncherProvider.java:121)
    at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484)
    at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789)
    ... 15 more
Caused by: java.lang.RuntimeException: No toolkit found
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:280)
    at com.sun.javafx.perf.PerformanceTracker.logEvent(PerformanceTracker.java:100)
    at javafx.scene.Node.<clinit>(Node.java:418)
    ... 20 more
salmonb commented 1 year ago

Glad to hear the Tally Counter is working.

Your desktop scenario is different. It's because you're environment (Docker or other virtualisation tool) doesn't support the hardware accelerated rendering the Gluon app expects by default. It's possible to switch to Software rendering using the enableSWRendering parameter(see https://docs.gluonhq.com/#_software_rendering).

WebFX doesn't provide an option for this, but you can try to temporarily manually modify the pom.xml under your gluon module and add <enableSWRendering>true</enableSWRendering> like this:

    <build>
        <plugins>
            <plugin>
                <groupId>com.gluonhq</groupId>
                <artifactId>gluonfx-maven-plugin</artifactId>
                <configuration>
                    <enableSWRendering>true</enableSWRendering>
                    ...

Let me know if the software rendering works for your Desktop scenario.

For your Android scenario, can you try cloning the Tally Counter demo and build the Android app? If it fails, this would mean the issue might be quite specific to your local environment.

amischler commented 1 year ago

Ok, I see. Actually I'm building the apk or fat-jar using a Docker container (based on ubuntu focal) on a MacOS host.

I'm running the fat-jar using the Host JVM java 19.0.2 2023-01-17 Java(TM) SE Runtime Environment (build 19.0.2+7-44) Java HotSpot(TM) 64-Bit Server VM (build 19.0.2+7-44, mixed mode, sharing), so it should have access to hardware accelerated rendering (I'm running other JavaFX apps without any issues). But I'll try switching to Software rendering.

I tried building the Tally Counter demo using the same process and I get the same black screen issue. However, the build process seems to work fine as I don't see any errors in the logs (see below). Do you think it could be related to building the APK from a Docker container?

[INFO] --------< dev.webfx:webfx-demo-tallycounter-application-gluon >---------
[INFO] Building WebFXDemoTallycounter 0.1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- gluonfx-maven-plugin:1.0.16:build (default-cli) @ webfx-demo-tallycounter-application-gluon ---
[INFO] Scanning for projects...
[INFO]
[INFO] --------< dev.webfx:webfx-demo-tallycounter-application-gluon >---------
[INFO] Building WebFXDemoTallycounter 0.1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> gluonfx-maven-plugin:1.0.16:compile (default-cli) > process-classes @ webfx-demo-tallycounter-application-gluon >>>
[INFO]
[INFO] --- maven-enforcer-plugin:3.1.0:enforce (enforce-maven) @ webfx-demo-tallycounter-application-gluon ---
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ webfx-demo-tallycounter-application-gluon ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ webfx-demo-tallycounter-application-gluon ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< gluonfx-maven-plugin:1.0.16:compile (default-cli) < process-classes @ webfx-demo-tallycounter-application-gluon <<<
[INFO]
[INFO]
[INFO] --- gluonfx-maven-plugin:1.0.16:compile (default-cli) @ webfx-demo-tallycounter-application-gluon ---
[Thu Mar 02 14:57:59 UTC 2023][INFO] ==================== COMPILE TASK ====================
             _______  ___      __   __  _______  __    _
            |       ||   |    |  | |  ||       ||  |  | |
            |    ___||   |    |  | |  ||   _   ||   |_| |
            |   | __ |   |    |  |_|  ||  | |  ||       |
            |   ||  ||   |___ |       ||  |_|  ||  _    |
            |   |_| ||       ||       ||       || | |   |
            |_______||_______||_______||_______||_|  |__|

    Access to the latest docs, tips and tricks and more info on
    how to get support? Register your usage of Gluon Substrate now at

    https://gluonhq.com/activate

[Thu Mar 02 14:58:00 UTC 2023][INFO] We will now compile your code for aarch64-linux-android. This may take some time.
[Thu Mar 02 14:58:01 UTC 2023][INFO] [SUB] Warning: Ignoring server-mode native-image argument --no-server.
[Thu Mar 02 14:58:01 UTC 2023][INFO] [SUB] Warning: Using a deprecated option --allow-incomplete-classpath from command line. Allowing an incomplete classpath is now the default. Use --link-at-build-time to report linking errors at image build time for a class or package.
[Thu Mar 02 14:58:05 UTC 2023][INFO] [SUB] ========================================================================================================================
[Thu Mar 02 14:58:05 UTC 2023][INFO] [SUB] GraalVM Native Image: Generating 'dev.webfx.platform.boot.applicationbooter' (shared library)...
[Thu Mar 02 14:58:05 UTC 2023][INFO] [SUB] ========================================================================================================================
[Thu Mar 02 14:58:08 UTC 2023][INFO] [SUB] [1/7] Initializing...                                                                                    (5.6s @ 0.14GB)
[Thu Mar 02 14:58:08 UTC 2023][INFO] [SUB]  Version info: 'GraalVM 22.1.0.1 Java 17 CE'
[Thu Mar 02 14:58:08 UTC 2023][INFO] [SUB]  Garbage collector: Serial GC
[Thu Mar 02 14:59:13 UTC 2023][INFO] [SUB] [2/7] Performing analysis...  [**********]                                                              (65.2s @ 2.74GB)
[Thu Mar 02 14:59:13 UTC 2023][INFO] [SUB]   11,579 (90.48%) of 12,797 classes reachable
[Thu Mar 02 14:59:13 UTC 2023][INFO] [SUB]   20,594 (66.36%) of 31,033 fields reachable
[Thu Mar 02 14:59:13 UTC 2023][INFO] [SUB]   56,535 (63.81%) of 88,599 methods reachable
[Thu Mar 02 14:59:13 UTC 2023][INFO] [SUB]      665 classes,   108 fields, and 1,973 methods registered for reflection
[Thu Mar 02 14:59:13 UTC 2023][INFO] [SUB]      111 classes,   129 fields, and   186 methods registered for JNI access
[Thu Mar 02 14:59:17 UTC 2023][INFO] [SUB] [3/7] Building universe...                                                                               (4.0s @ 2.13GB)
[Thu Mar 02 14:59:21 UTC 2023][INFO] [SUB] [4/7] Parsing methods...      [**]                                                                       (3.5s @ 2.23GB)
[Thu Mar 02 14:59:29 UTC 2023][INFO] [SUB] [5/7] Inlining methods...     [****]                                                                     (7.9s @ 1.04GB)
[Thu Mar 02 15:00:09 UTC 2023][INFO] [SUB] [6/7] Compiling methods...    [******]                                                                  (39.3s @ 1.96GB)
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB]
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB] ------------------------------------------------------------------------------------------------------------------------
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB]                        13.9s (10.2% of total time) in 63 GCs | Peak RSS: 4.37GB | CPU load: 3.48
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB] ------------------------------------------------------------------------------------------------------------------------
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB] Produced artifacts:
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB]  /root/webfx-demo-tallycounter/webfx-demo-tallycounter-application-gluon/target/gluonfx/aarch64-android/gvm/WebFXDemoTallycounter/dev.webfx.platform.boot.applicationbooter.h (header)
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB]  /root/webfx-demo-tallycounter/webfx-demo-tallycounter-application-gluon/target/gluonfx/aarch64-android/gvm/WebFXDemoTallycounter/graal_isolate.h (header)
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB]  /root/webfx-demo-tallycounter/webfx-demo-tallycounter-application-gluon/target/gluonfx/aarch64-android/gvm/WebFXDemoTallycounter/dev.webfx.platform.boot.applicationbooter_dynamic.h (header)
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB]  /root/webfx-demo-tallycounter/webfx-demo-tallycounter-application-gluon/target/gluonfx/aarch64-android/gvm/WebFXDemoTallycounter/graal_isolate_dynamic.h (header)
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB]  /root/webfx-demo-tallycounter/webfx-demo-tallycounter-application-gluon/target/gluonfx/aarch64-android/gvm/WebFXDemoTallycounter/dev.webfx.platform.boot.applicationbooter.build_artifacts.txt
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB] ========================================================================================================================
[Thu Mar 02 15:00:17 UTC 2023][INFO] [SUB] Finished generating 'dev.webfx.platform.boot.applicationbooter' in 2m 15s.
[INFO]
[INFO] --- gluonfx-maven-plugin:1.0.16:link (default-cli) @ webfx-demo-tallycounter-application-gluon ---
[Thu Mar 02 15:00:18 UTC 2023][INFO] ==================== LINK TASK ====================
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:21 min
[INFO] Finished at: 2023-03-02T15:00:19Z
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --------< dev.webfx:webfx-demo-tallycounter-application-gluon >---------
[INFO] Building WebFXDemoTallycounter 0.1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- gluonfx-maven-plugin:1.0.16:package (default-cli) @ webfx-demo-tallycounter-application-gluon ---
[Thu Mar 02 15:00:19 UTC 2023][INFO] ==================== PACKAGE TASK ====================
[Thu Mar 02 15:00:20 UTC 2023][INFO] Default Android manifest generated in /root/webfx-demo-tallycounter/webfx-demo-tallycounter-application-gluon/target/gluonfx/aarch64-android/gensrc/android/AndroidManifest.xml.
Consider copying it to /root/webfx-demo-tallycounter/webfx-demo-tallycounter-application-gluon/src/android/AndroidManifest.xml before performing any modification
             _______  ___      __   __  _______  __    _
            |       ||   |    |  | |  ||       ||  |  | |
            |    ___||   |    |  | |  ||   _   ||   |_| |
            |   | __ |   |    |  |_|  ||  | |  ||       |
            |   ||  ||   |___ |       ||  |_|  ||  _    |
            |   |_| ||       ||       ||       || | |   |
            |_______||_______||_______||_______||_|  |__|

    Access to the latest docs, tips and tricks and more info on
    how to get support? Register your usage of Gluon Substrate now at

    https://gluonhq.com/activate

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:04 min
[INFO] Finished at: 2023-03-02T15:01:00Z
[INFO] ------------------------------------------------------------------------
salmonb commented 1 year ago

It's possible that the OpenJFX jars embed in your fat jars include the software rendering backup option by default. When Gluon compiles an app into native, it tries to make it as small as possible, that's why the software rendering is not included by default (and this works in most common scenarios). I'm not sure that the fact your fat jars are running ok is a proof that your environment supports hardware accelerated rendering.

It's possible that your issue is related to building from a Docker container, but I don't know why the build works and not the final app...

Have you tried to build the native apps for macOS and iOS directly from your Mac?

amischler commented 1 year ago

I this an excepted behavior? From my understanding the fat jar should not be platform specific and could be built on any platform but maybe I'm missing something here.

I will give a try to the native apps for macOS/iOS on the Mac and try to investigate further on the Android build issue, by running the build from an Ubuntu VM.

salmonb commented 1 year ago

The fat jar includes all libraries, which in general are written in pure Java and therefore not platform specific, but complex libraries like JavaFX do have some low level layers not written in Java to access the hardware. So the fat jar of a JavaFX app is actually platform dependent. Maybe there is a way to include all platforms (macOS, Linux & Windwos) in a big fat jar 😄

Also you can maybe investigate the prism.order VM parameter when launching your fat jar. Does -Dprism.order=sw make a difference for example?

AlexBelchUK commented 1 year ago

I'll just add a small note that on some Linux versions the default JDK is the visual display headerless version for use with web servers. Sometimes the full open JDK has to be downloaded and installed to use with ui desktop applications. Once downloaded and installed it needs selecting using the alternates command.