在Android中构建Javafx应用程序时遇到以下异常。
error: Error: No resource found that matches the given name (at 'icon' with value '@mipmap/ic_launcher').
:processAndroidDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processAndroidDebugResources'.
> Process 'command 'E:Androidandroid-sdkbuild-tools23.0.1aapt.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 24.005 secs
Build failure (see the Notifications window for stacktrace): gradle :android
,我已经安装了android sdk,并指向ANDROID_HOME
。这是我在build.gradle
中的构建脚本。
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b4'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
}
mainClassName = 'com.javafxport.JavaFXPort'
jfxmobile {
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
}
}
我试图安装非常简单的javafx应用程序到我的android设备。
首先,检查NetBeans的Gluon插件是否更新。目前你可以使用1.0.2版本,它将为你提供一个更新版本的插件:
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b9'
}
实际上,根据这个,你可以手动更新为:
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.0.1'
}
现在检查Android SDK,使用SDK管理器,你已经安装了SDK版本22和构建工具版本22,但不是版本23,这是新的Android M,还不支持JavaFXPorts。