Call to CompassService causing black screen on iOS - gluon

The following call to compassservice is causing black screen (with charge icon visible) on iOS. It might have something to do with recent iOS 12 update?
Services.get(CompassService.class).ifPresent(consumer -> {
});
Adding the call in
public BasicView() {
Label label = new Label("Hello JavaFX World!");
Button button = new Button("Change the World!");
button.setGraphic(new Icon(MaterialDesignIcon.LANGUAGE));
button.setOnAction(e -> label.setText("Hello JavaFX Universe!"));
VBox controls = new VBox(15.0, label, button);
controls.setAlignment(Pos.CENTER);
setCenter(controls);
Services.get(CompassService.class).ifPresent(consumer -> {
});
}
also produces the issue in a newly created project.
I still get the black screen with battery level visible when using 1.3.15 of the plugin and the following console output:
Root pattern javax.annotations.**.* matches no classes
Root pattern javax.inject.**.* matches no classes
javax.xml.stream.XMLEventFactory=com.sun.xml.stream.events.ZephyrEvent...
java.vendor.url=http://www.robovm.org/
java.ext.dirs=
line.separator=
file.encoding=UTF-8
java.runtime.version=0.9
user.name=mobile
java.compiler=
prism.static.libraries=true
android.icu.unicode.version=6.2
javax.xml.stream.XMLOutputFactory=com.sun.xml.stream.ZephyrWriterFactory
java.version=0
android.icu.library.version=51.1.0.1
os.arch=aarch64
java.io.tmpdir=/private/var/mobile/Containers/Data/A...
glass.platform=ios
android.zlib.version=1.2.8
user.language=en
java.vm.version=2.3.5-SNAPSHOT
com.sun.javafx.isEmbedded=true
javax.xml.stream.XMLInputFactory=com.sun.xml.stream.ZephyrParserFactory
path.separator=:
java.runtime.name=RoboVM Runtime
java.specification.version=0.9
user.dir=/private/var/mobile/Containers/Data/A...
java.vm.specification.vendor=RoboVM
java.vm.name=RoboVM
java.vm.specification.version=0.9
prism.useNativeIIO=false
user.home=/private/var/mobile/Containers/Data/A...
jfxmedia.platforms=IOSPlatform
java.specification.name=RoboVM Core Library
file.separator=/
user.variant=
os.version=12.0
java.boot.class.path=/private/var/containers/Bundle/Applic...
java.vm.specification.name=RoboVM Virtual Machine Specification
javafx.platform=ios
user.region=SE
os.name=iOS
java.class.path=/private/var/containers/Bundle/Applic...
prism.verbose=true
java.specification.vendor=RoboVM
java.vm.vendor=RoboVM
prism.mintexturesize=16
prism.allowhidpi=true
java.vendor=RoboVM
android.icu.cldr.version=23.0
android.openssl.version=OpenSSL 1.0.1e 11 Feb 2013
java.home=/private/var/containers/Bundle/Applic...
java.vm.vendor.url=http://www.robovm.org/
java.class.version=50.0
Prism pipeline init order: es2
Using native-based Pisces rasterizer
Using dirty region optimizations
Using system sized mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
Loading ES2 native library ... prism_es2
succeeded.
GLFactory using com.sun.prism.es2.IOSGLFactory
IOSWindowSystemInterface : share 0 view 0 pf otready
GL_VERSION string = OpenGL ES 2.0 Apple A8 GPU - 128.28.1
GL_VERSION (major.minor) = 0.0
initialize() returns 4456491632
(X) Got class = class com.sun.prism.es2.ES2Pipeline
Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline
IOSWindowSystemInterface : share 807dc360 view 0 pf otready
GL_VERSION string = OpenGL ES 2.0 Apple A8 GPU - 128.28.1
GL_VERSION (major.minor) = 0.0
CTXINFO vendor
CTXINFO renderer
CTXINFO glExtensions
CTXINFO GL_ARB_pixel_buffer_object
CTXINFO allocate the structure
CTXINFO set function pointers
Attributes = onScreen: trueredSize : 8, greenSize : 8, blueSize : 8, alphaSize : 8, depthSize : 24, doubleBuffer : true
initialize() returns 4454406448
IOSWindowSystemInterface : share 807dc360 view 0 pf otready
GL_VERSION string = OpenGL ES 2.0 Apple A8 GPU - 128.28.1
GL_VERSION (major.minor) = 0.0
CTXINFO vendor
CTXINFO renderer
CTXINFO glExtensions
CTXINFO GL_ARB_pixel_buffer_object
CTXINFO allocate the structure
CTXINFO set function pointers
Attributes = onScreen: trueredSize : 8, greenSize : 8, blueSize : 8, alphaSize : 8, depthSize : 24, doubleBuffer : true
initialize() returns 4456522224
Maximum supported texture size: 4096
Non power of two texture support = false
Maximum number of vertex attributes = 16
Maximum number of uniform vertex components = 512
Maximum number of uniform fragment components = 256
Maximum number of varying components = 32
Maximum number of texture units usable in a vertex shader = 8
Maximum number of texture units usable in a fragment shader = 8
Graphics Vendor: Apple Inc.
Renderer: Apple A8 GPU
Version: OpenGL ES 2.0 Apple A8 GPU - 128.28.1
vsync: true vpipe: true
[WARN] java.lang.Class: Class.forName() failed to load 'com.sun.javafx.font.t2k.T2KFactory'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>com.sun.javafx.font.t2k.T2KFactory</pattern></forceLinkClasses> to your robovm.xml file to link it in.
2018-10-13 16:30:45.649938+0200 CompassApplicationApp[6651:1823208] Done creating private storage /var/mobile/Containers/Data/Application/897B119A-3C3E-4228-A28E-19E459DA8A16/Library/gluon
[WARN] java.lang.Class: Class.forName() failed to load 'com.sun.javafx.tk.quantum.QuantumMessagesBundle_en_SE'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>com.sun.javafx.tk.quantum.QuantumMessagesBundle_en_SE</pattern></forceLinkClasses> to your robovm.xml file to link it in.
[WARN] java.lang.Class: Class.forName() failed to load 'com.sun.javafx.tk.quantum.QuantumMessagesBundle_en'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>com.sun.javafx.tk.quantum.QuantumMessagesBundle_en</pattern></forceLinkClasses> to your robovm.xml file to link it in.
[WARN] java.lang.Class: Class.forName() failed to load 'com.sun.javafx.tk.quantum.QuantumMessagesBundle'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>com.sun.javafx.tk.quantum.QuantumMessagesBundle</pattern></forceLinkClasses> to your robovm.xml file to link it in.
[WARN] java.lang.Class: Class.forName() failed to load 'com.oracle.jrockit.jfr.FlightRecorder'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>com.oracle.jrockit.jfr.FlightRecorder</pattern></forceLinkClasses> to your robovm.xml file to link it in.
2018-10-13 16:30:58.392847+0200 CompassApplicationApp[6651:1823245] XPC connection interrupted
The build script is the following:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.15'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'com.gluonapplication.CompassApplication'
dependencies {
compile 'com.gluonhq:charm:5.0.0'
}
jfxmobile {
downConfig {
version = '3.8.4'
// Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
plugins 'compass', 'display', 'lifecycle', 'magnetometer', 'statusbar', 'storage'
}
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
// javafxportsVersion="8.60.11"
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*'
]
}
}
Running jdk1.8.0_181
I can also the mention the screen is completely white when shutting down and restarting the app.

Related

Failed to execute 'texImage2D' on 'WebGLRenderingContext': No function was found that matched the signature provided

I'm using ionic 3 framework to build an Android and Electron Application.
Now I've to add Three.js (the version in use is the r110) in the app and I have no experience in WebGL nor three.js.
When I run the application with Electron all seems fine, but when I run the app in an android emulator with Android API 28 this error happens "Failed to execute 'texImage2D' on 'WebGLRenderingContext': No function was found that matched the signature provided."
I think the problem is that the version of chrome used by Android is "Chrome/69.0.3497.100", while in Electron is "Chrome/76.0.3809.146".
This is the part of code that use the texImage2D function
private loadCollada() {
const loader = new ColladaLoader();
loader.load('assets/edo/model/model.dae', (collada) => {
this.dae = collada.scene;
this.dae.scale.x = this.dae.scale.y = this.dae.scale.z = 1;
this.dae.updateMatrix();
this.scene.add(this.dae);
});
}
I found in three.js library that the error is logged in three.module.js
function texImage2D() {
try {
gl.texImage2D.apply( gl, arguments );
} catch ( error ) {
console.error( 'THREE.WebGLState:', error );
}
}
I don't know if it might be useful but I have also this message in my console printed so many times.
[.WebGL-0xcba04400]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. [file:///android_asset/www/index.html]
There is a workaround or a way to fix this problem?

kernel module not getting registered with kernel when built as module, though if built-in it works

This is my first time working with kernel modules at core. I am trying to run a sensor BMC150 for which the kernel already has an IIO-framework driver :
https://elixir.bootlin.com/linux/latest/source/drivers/iio/magnetometer
I can see this :
static const struct of_device_id bmc150_magn_of_match[] = {
{ .compatible = "bosch,bmc150_magn" },
{ .compatible = "bosch,bmc156_magn" },
{ .compatible = "bosch,bmm150_magn" },
{ }
};
So I created my device tree node like this :
magn#13 {
compatible = "bosch,bmc150_magn";
reg = <0x13>;
status = "ok";
};
Now if I have built the module as built-in, I can see the driver under /sys/bus/i2c/drivers and the probe happens and I can see the device under /sys/bus/iio/devices and everything works fine and I am able to get the readings from the sensor.
However, if I would have build the module as 'M' (not built-in), I do not see the module under /sys/bus/i2c/drivers and also no IIO devices get generated. Seems like the kernel does not know about the driver.
What is the problem here ? (I am using busybox rootfs and I used make modules_install to install the modules to the rootfs. If I do "modprobe the driver loads and everything works fine)
i read in this SO post that if a module has other modules yet-to-be loaded as dependencies then these problems may happen. Is this the issue, am not sure. Please guide.

JavaFXPorts - Changing scene results in Invalid Touch point ID error

I have an app with 2 scenes. The app starts with the first scene (set to full screen mode), and when I tap a point on the screen, it then switches to the second scene (which is also set to full screen).
When I run it on Windows, it works fine. When I run it on Android, I get an error after switching to the second scene. The second scene pops up on the screen briefly and then crashes with the following exception in the logcat:
java.lang.RuntimeException: Platform reported wrong touch point ID
at javafx.scene.Scene$TouchMap.get(Scene.java:5455)
at javafx.scene.Scene$ScenePeerListener.touchEventNext(Scene.java:2716)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$null$361(GlassViewEventHandler.java:1148)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.access$lambda$20(GlassViewEventHandler.java)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$23.run(Unknown Source)
at java.security.AccessController.doPrivileged(AccessController.java:52)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleNextTouchEvent$362(GlassViewEventHandler.java:1127)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.access$lambda$17(GlassViewEventHandler.java)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$20.get(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:391)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleNextTouchEvent(GlassViewEventHandler.java:1126)
at com.sun.glass.ui.View.handleNextTouchEvent(View.java:579)
at com.sun.glass.ui.View.notifyNextTouchEvent(View.java:1050)
at com.sun.glass.ui.TouchInputSupport.notifyNextTouchEvent(TouchInputSupport.java:141)
at com.sun.glass.ui.monocle.TouchInput.dispatchPoint(TouchInput.java:131)
at com.sun.glass.ui.monocle.TouchInput.lambda$postPoint$82(TouchInput.java:155)
at com.sun.glass.ui.monocle.TouchInput.access$lambda$3(TouchInput.java)
at com.sun.glass.ui.monocle.TouchInput$$Lambda$4.run(Unknown Source)
at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
at java.lang.Thread.run(Thread.java:818)
Any suggestions on solving this would be great.
Here's the build.gradle file as requested:
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.javafxports.jfxmobile'
dependencies {
compile project(':Util')
compile files('D:/DevTools/minimal-json/minimal-json7.jar')
compile files('D:/DevTools/sqlite-jdbc/sqlite-jdbc-3.8.11.2.jar')
androidRuntime 'org.sqldroid:sqldroid:1.0.3'
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.8'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
}
mainClassName = 'com.myapp.Client'
jfxmobile {
javafxportsVersion = '8.60.7'
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
forceLinkClasses = [ 'com.myapp.**.*', 'SQLite.**.*']
infoPList = file('src/ios/Default-Info.plist')
}
}
Thanks!
I can reproduce your crash and I'll file a bug.
While on Desktop it is pretty common having several scenes or even stages, that's not the case on mobile.
Instead, we have one single stage, and we don't change the scene all the time, we just change its content.
Using Gluon Mobile, there are View nodes, that allow you precisely that: use as many views as you need to have different content, and switch between then when you need.
You can have a look at the GluonSQLite sample, that includes SQLite but it only has one View, or to other multi-view samples here like Notes or Comments.

How to Determine an mxmlc-compiled SWF File Was Built in Debug or Release Mode

First of all, I'm NOT talking about if the player is a debugger or not. (EDIT: it IS actually related to the debugger player)
I use mxmlc to compile a very simple swf file with -debug=false:
mac-108:tmp admin$ "/Applications/Adobe Flash Builder 4.7/sdks/4.6.0/bin/mxmlc" +configname flex -debug=true -static-link-runtime-shared-libraries=true Main.as
Loading configuration file /Applications/Adobe Flash Builder 4.7/sdks/4.6.0/frameworks/flex-config.xml
/Users/admin/tmp/Main.swf (987 bytes)
mac-108:tmp admin$
The Main.as:
package {
import flash.display.MovieClip;
import flash.text.*;
public class Main extends MovieClip {
public function Main() {
// Reference: http://stackoverflow.com/questions/185477/determine-if-swf-is-in-a-debug-player-or-mode
var st:String = new Error().getStackTrace();
var isDebugBuild:Boolean = (st && st.search(/:[0-9]+]$/m) > -1);
var my_st:String = "st: " + (st == null ? 'Null' : st);
var my_DR:String = isDebugBuild?"Debug":"Release";
var obj:TextField = new TextField();
obj.text = my_st + "\n" + my_DR;
this.addChild(obj);
}
}
}
Then I open Main.swf in my Chrome browser, but I see:
st:Null
Release
Which is so weird that, apparently, I have set -debug=true, why does NOT the popular method to determine if an swf is in Debug or Release work.
However, if I move my code to the Flash Builder 4.7, it will give me the Debug output (instead of Release).
It turns out that when the SWF is built in Debug mode, in order to test if it's in debug mode, the Flash Player must also be a debugger using Capabilities.isDebugger.

how do I set quad buffering with jogl 2.0

I'm trying to create a 3d renderer for stereo vision with quad buffering with Processing/Java. The hardware I'm using is ready for this so that's not the problem.
I had a stereo.jar library in jogl 1.0 working for Processing 1.5, but now I have to use Processing 2.0 and jogl 2.0 therefore I have to adapt the library.
Some things are changed in the source code of Jogl and Processing and I'm having a hard time trying to figure out how to tell Processing I want to use quad buffering.
Here's the previous code:
public class Theatre extends PGraphicsOpenGL{
protected void allocate()
{
if (context == null)
{
// If OpenGL 2X or 4X smoothing is enabled, setup caps object for them
GLCapabilities capabilities = new GLCapabilities();
// Starting in release 0158, OpenGL smoothing is always enabled
if (!hints[DISABLE_OPENGL_2X_SMOOTH])
{
capabilities.setSampleBuffers(true);
capabilities.setNumSamples(2);
}
else if (hints[ENABLE_OPENGL_4X_SMOOTH])
{
capabilities.setSampleBuffers(true);
capabilities.setNumSamples(4);
}
capabilities.setStereo(true);
// get a rendering surface and a context for this canvas
GLDrawableFactory factory = GLDrawableFactory.getFactory();
drawable = factory.getGLDrawable(parent, capabilities, null);
context = drawable.createContext(null);
// need to get proper opengl context since will be needed below
gl = context.getGL();
// Flag defaults to be reset on the next trip into beginDraw().
settingsInited = false;
}
else
{
// The following three lines are a fix for Bug #1176
// http://dev.processing.org/bugs/show_bug.cgi?id=1176
context.destroy();
context = drawable.createContext(null);
gl = context.getGL();
reapplySettings();
}
}
}
This was the renderer of the old library. In order to use it, I needed to do size(100, 100, "stereo.Theatre").
Now I'm trying to do the stereo directly in my Processing sketch. Here's what I'm trying:
PGraphicsOpenGL pg = ((PGraphicsOpenGL)g);
pgl = pg.beginPGL();
gl = pgl.gl;
glu = pg.pgl.glu;
gl2 = pgl.gl.getGL2();
GLProfile profile = GLProfile.get(GLProfile.GL2);
GLCapabilities capabilities = new GLCapabilities(profile);
capabilities.setSampleBuffers(true);
capabilities.setNumSamples(4);
capabilities.setStereo(true);
GLDrawableFactory factory = GLDrawableFactory.getFactory(profile);
If I go on, I should do something like this:
drawable = factory.getGLDrawable(parent, capabilities, null);
but drawable isn't a field anymore and I can't find a way to do it.
How do I set quad buffering?
If I try this:
gl2.glDrawBuffer(GL.GL_BACK_RIGHT);
it obviously doesn't work :/
Thanks.

Resources