对我来说,您必须为Gluon.attach使用Java11似乎很奇怪,但是由于Retrolambda问题,您无法构建apk,因为它们是用Java 11编译的。
但是使用JDK1.8,您可以构建apk,但是不能使用gluon.attach,而是使用gluon.charm.plugin。
我是否需要特殊的gradle配置才能使用gluon.attach生成apk?
这是我的gradle文件:
buildscript {
repositories {
jcenter()
mavenLocal()
mavenCentral()
}
dependencies {
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.7.0'
classpath 'org.javafxports:jfxmobile-plugin:1.3.12'
}
}
plugins {
id 'java-library'
id "java"
id "eclipse"
id 'application'
}
apply plugin: "org.javafxports.jfxmobile"
repositories {
jcenter()
google()
mavenCentral()
mavenLocal()
maven {
url 'https://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
sourceSets {
main.java.srcDir "src/main/java"
main.resources.srcDir "src/main/resources"
}
mainClassName = 'de.test.main.App'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
api 'org.apache.commons:commons-math3:3.6.1'
implementation 'com.google.guava:guava:27.0.1-jre'
testImplementation 'junit:junit:4.12'
//GLUON
compile group: 'com.gluonhq', name: 'charm-down-core', version: '3.8.6'
compile group: 'com.gluonhq', name: 'charm-glisten', version: '5.0.0'
compile group: 'com.gluonhq.attach', name: 'display', version: '4.0.2'
compile group: 'com.gluonhq.attach', name: 'util', version: '4.0.1.1'
compile group: 'com.gluonhq.attach', name: 'orientation', version: '4.0.1.1'
compile group: 'com.gluonhq.attach', name: 'magnetometer', version: '4.0.1.1'
//END
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
compile group: 'org.reflections', name: 'reflections', version: '0.9.11'
compile group: 'com.gluonhq', name: 'charm', version: '5.0.1'
}
jfxmobile {
downConfig {
version = '3.8.6'
plugins 'display', 'lifecycle', 'statusbar', 'storage'
}
android {
manifest = 'src/android/AndroidManifest.xml'
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'icon.png'
}
}
ios {
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*'
]
}
}
或者此功能仅适用于iOS吗?