-1

当我将 JFoenix 与 JavaFXPorts 一起使用时,这是来自 logcat 的错误:

10-31 11:01:10.601: E/AndroidRuntime(5873): java.lang.IncompatibleClassChangeError: The method 'javafx.scene.layout.Background com.jfoenix.skins.JFXButtonSkin.lambda$new$251(com.jfoenix.controls.JFXButton)' was expected to be of type direct but instead was found to be of type virtual (declaration of 'com.jfoenix.skins.JFXButtonSkin' appears in /data/app/sk.jfoenixtestapplication-1/base.apk)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.jfoenix.skins.JFXButtonSkin.access$lambda$3(JFXButtonSkin.java)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.jfoenix.skins.JFXButtonSkin$$Lambda$4.call(Unknown Source)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.beans.binding.Bindings$6.computeValue(Bindings.java:338)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.beans.binding.ObjectBinding.get(ObjectBinding.java:153)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:50)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.binding.ExpressionHelper.addListener(ExpressionHelper.java:53)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.beans.binding.ObjectBinding.addListener(ObjectBinding.java:72)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.beans.property.ObjectPropertyBase.bind(ObjectPropertyBase.java:173)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.css.StyleableObjectProperty.bind(StyleableObjectProperty.java:75)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.jfoenix.skins.JFXButtonSkin.<init>(JFXButtonSkin.java:108)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.jfoenix.controls.JFXButton.createDefaultSkin(JFXButton.java:91)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.scene.control.Control.impl_processCSS(Control.java:858)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.scene.Node.processCSS(Node.java:9056)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.scene.Node.processCSS(Node.java:9049)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.scene.Scene.doCSSPass(Scene.java:545)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.scene.Scene.access$3600(Scene.java:159)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2396)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Toolkit.java:348)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.tk.Toolkit.access$lambda$3(Toolkit.java)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.tk.Toolkit$$Lambda$4.run(Unknown Source)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at java.security.AccessController.doPrivileged(AccessController.java:52)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:347)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:374)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:525)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:503)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$387(QuantumToolkit.java:321)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.tk.quantum.QuantumToolkit.access$lambda$2(QuantumToolkit.java)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$3.run(Unknown Source)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
10-31 11:01:10.601: E/AndroidRuntime(5873):     at java.lang.Thread.run(Thread.java:818)

我在 NetBeans 中使用 JavaFXPorts 8.60.8 和 Gluon 移动插件。

4

1 回答 1

0

新的 jfxmobile 插件 1.1.0+ 包括一些与如何将 Retrolambda 应用于项目和依赖项相关的更改

在 1.1.0 之前,每个依赖项都应该没有 lambda 表达式,因为 retrolambda 插件无法对它们起作用。

从 1.1.0+ 开始,该插件也将 retrolambda 应用于第三方依赖项。

如果这些依赖项使用的是 retrolambda 插件,我们不能应用它两次,这将失败,并出现 OP 发布的异常。

为了避免这个问题,我们可以使用compileNoRetrolambdaor runtimeNoRetrolambda,而不是通常的compileor runtime,我们将只在没有retrolambda的依赖项上使用它:

dependencies {
    compile 'com.gluonhq:charm:4.0.0'
    compileNoRetrolambda 'com.airhacks:afterburner.mfx:1.6.2'
}
于 2016-10-31T14:55:24.180 回答