当我从键盘输入任何字符到 TextField 时,最新的 JavaFXPorts 8.60.7 出现问题,应用程序将崩溃。我正在使用安卓 5.0.1。早些时候我的应用程序是在 JavaFXPorts 8.60.6 上开发的,我的应用程序在那里工作,我可以在 8.60.6 中,在 TextField 中输入一个字符。
我在 logcat 中收到此错误:
04-15 21:56:22.066 10732-10769/? E/AndroidRuntime: FATAL EXCEPTION: JavaFX Application Thread
Process: pl.plf.myapp, PID: 10732
java.lang.NoSuchMethodError: No static method dispatchKeyEvent(II[CI)V in class Lcom/sun/glass/ui/monocle/AndroidInputDeviceRegistry; or its super classes (declaration of 'com.sun.glass.ui.monocle.AndroidInputDeviceRegistry' appears in /data/app/pl.plf.myapp-1/base.apk)
at javafxports.android.KeyEventProcessor$1.run(KeyEventProcessor.java:53)
at com.sun.javafx.application.PlatformImpl.lambda$null$155(PlatformImpl.java:295)
at com.sun.javafx.application.PlatformImpl.access$lambda$18(PlatformImpl.java)
at com.sun.javafx.application.PlatformImpl$$Lambda$19.run(Unknown Source)
at java.security.AccessController.doPrivileged(AccessController.java:52)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$156(PlatformImpl.java:294)
at com.sun.javafx.application.PlatformImpl.access$lambda$5(PlatformImpl.java)
at com.sun.javafx.application.PlatformImpl$$Lambda$6.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)
这是我的 build.gradle:
apply plugin: 'java'
apply plugin: 'war'
sourceCompatibility = 1.7
targetCompatibility = 1.7
version = '1.0'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.8'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
mavenCentral()
}
dependencies {
compile project(":ApiCore")
compile project(":Validation")
compile project(":PLFModel")
compile 'org.javafxports:jfxdvk:8.60.7'
compile fileTree(dir: 'libs', include: '*.jar')
runtime fileTree(dir: 'libs', include: '*.jar')
}
mainClassName = 'pl.plf.myapp.MainApp'
jfxmobile {
android {
javafxportsVersion = '8.60.7'
manifest = 'src/android/AndroidManifest.xml'
androidSdk = '/home/user/Android/Sdk'
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
}
dexOptions {
javaMaxHeapSize "4g"
}
}
}
谢谢你的帮助。