我得到 Execution failed for task ':ChatAppGluonApp:applyRetrobuffer'.
试图创建一个Android APK . 我'm Using Eclipse Oxygen (4.7.3RC2) and Windows 7. The same error comes up with macOs 10.13.1 and Eclipse Oxygen (4.7.2). On both operating systems I'使用Android 26和Build Tools 26.0.2 .
我尝试使用Java 8和9运行,但结果是一样的 . 该程序在桌面上运行正常 .
buildscript {
repositories {
jcenter()
google()
maven{
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:2.0.17'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'de.....ChatApplication'
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile 'com.gluonhq:charm:4.4.0-jdk9'
androidRuntime 'com.gluonhq:charm:4.4.1'
compile 'com.airhacks:afterburner.mfx:1.6.3'
compile files('libs/chatFx.jar')
//compile files('libs/chatFxTest.jar')
compile files('libs/miglayout-core-5.0.jar')
compile files('libs/miglayout-javafx-5.0.jar')
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
// https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305
compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
// https://mvnrepository.com/artifact/javax.xml.ws/jaxws-api
compile group: 'javax.xml.ws', name: 'jaxws-api', version: '2.2.6'
}
jfxmobile {
downConfig {
version = '3.7.0'
// Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
plugins 'display', 'lifecycle', 'statusbar', 'storage'
}
android {
compileSdkVersion = '26'
buildToolsVersion = '26.0.2'
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*'
]
}
}
2 回答
根据您对
applyRetrobuffer
任务的例外情况:Android不支持Java 9,因此在使用jfxmobile 2.0时 . 所有Android依赖项都必须使用Java 8目标进行编译 .
在您的情况下,异常表示类路径上至少有一个类已使用java 9或更高版本作为目标进行编译 .
已经提交issue以显示有关产生故障的类的更多信息 .
我不能说你的本地依赖,但其余的工作对我来说很好 . 至于
miglayout-*-5.0
,除非您编译了本地版本,否则它是从2014年开始的 .无论如何,只需确保将此添加到您使用Java 9自己构建的任何本地依赖项:
顺便说一句,当您设法成功应用retrobuffer任务时,您将与依赖项中的重复文件发生冲突,例如
META-INF/LICENSE.txt
位于不同的jar中 . 使用packagingOptions
,就像在link中一样 .jfxmobile 2.x为移动设备提供Java 9 BUT支持,您只能针对iOS进行定位,因为目前还没有支持Java 9 API的Android版本