java.lang.StackOverflowError when pressing FX ComboBox on Android

南楼画角 提交于 2019-11-26 18:40:01

问题


When using JavaFXPorts on Android (Android 4.1.1 on Asus Transformer Prime TF201 tablet), a java.lang.StackOverflowError is thrown when pressing on a ComboBox (see below the top stacks of the stacktrace).

It happens in a ComboBox in my FX application and is also 100% reproducible with the ComboBox example that is in Ensemble. In other words: can't use JavaFX ComboBox.

I'm aware of the Android stack size limit posted in many forums and there are various suggestions on what to do when it happens with Android UI and Android APIs. However, can't find a relevant idea to apply when using JavaFX UI and JavaFXPorts.

Any idea for a fix\tweak\workaround would be much appreciated.

E/AndroidRuntime(32212): FATAL EXCEPTION: JavaFX Application Thread
E/AndroidRuntime(32212): java.lang.StackOverflowError
E/AndroidRuntime(32212):        at javafx.scene.Node.getTransformedBounds(Node.java:3422)
E/AndroidRuntime(32212):        at javafx.scene.Parent.getChildTransformedBounds(Parent.java:1724)
E/AndroidRuntime(32212):        at javafx.scene.Parent.recomputeBounds(Parent.java:1516)
E/AndroidRuntime(32212):        at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
E/AndroidRuntime(32212):        at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
E/AndroidRuntime(32212):        at javafx.scene.Node.updateGeomBounds(Node.java:3577)
E/AndroidRuntime(32212):        at javafx.scene.Node.getGeomBounds(Node.java:3530)

回答1:


You can create the java.custom.properties file, and include in it this property:

monocle.stackSize=128000

You can override other system properties as well by including them with their new values.

Put the file at the root of your classpath, e.g. in the folder src/android/resources of your project.

You can find this FAQ here here and all the documentation for JavaFXPorts here.

Check if this solves your exception.



来源:https://stackoverflow.com/questions/34752754/java-lang-stackoverflowerror-when-pressing-fx-combobox-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!