Javafx应用程序是简单的hello world应用程序。
./gradlew run
有效。
但是
./gradlew android
给出以下输出。
> Task :shrinkMultiDexComponents FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shrinkMultiDexComponents'.
> java.io.IOException: Can't write [/home/oreo/eclipse-workspace/gdemo/build/javafxports/tmp/android/multi-dex/componentClasses.jar] (Can't read [/home/oreo/eclipse-workspace/gdemo/build/javafxports/tmp/android/multi-dex/allclasses.jar] (Duplicate zip entry [allclasses.jar:com/sun/javafx/beans/IDProperty.class]))
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 28s
8 actionable tasks: 7 executed, 1 up-to-date
这是我的build.gradle文件
buildscript {
repositories {
jcenter()
mavenLocal()
maven { url "http://nexus.gluonhq.com/nexus/content/repositories/releases/" }
maven { url "https://maven.google.com/" }
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:2.0.30'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
mavenLocal()
maven { url "http://nexus.gluonhq.com/nexus/content/repositories/releases/" }
maven { url "https://maven.google.com/" }
}
mainClassName = 'application.Main'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar') //to include jfxrt.jar
}
jfxmobile {
android {
applicationPackage = 'org.testing.app'
compileSdkVersion = 29
}
}
我在不同的gradle版本上得到了相同的输出。 gradle 2.2和5.5
可能是什么问题?如果我不能使用前端创建跨平台应用程序,我应该将javafx包含在文件之外,还是应该保留javafx。我花了很多天的时间来解决很多问题,但是这并没有做到。现在我正在考虑更好地飞镖。